Forums
-
- Forum
- Posts
-
- Installing BuddyPress
- 23,840
- How-to & Troubleshooting
- 129,881
- Creating & Extending
- 25,910
- Requests & Feedback
- 9,553
- Third Party Plugins
- 9,832
- Showcase
- 3,316
- Ideas
- 1,402
- Miscellaneous
- 9,184
-
You’re probably calling the BP function before BP has loaded.
Read this: https://codex.buddypress.org/plugindev/checking-buddypress-is-active/
There may be additional problems with your code including the issue raised by @henrywright