You can get this fatal error if you plugin is loaded before BuddyPress, if you’re creating extension for BuddyPress, first you should check if BuddyPress is active and loaded, here is suggested method from BP Codex.
/*
Plugin Name: My Plugin
Plugin URI: http://example.org/my-plugin/
Description: My BuddyPress plugin
Version: 1.0
Requires at least: WordPress 2.9.1 / BuddyPress 1.2
Tested up to: WordPress 2.9.1 / BuddyPress 1.2
License: GNU/GPL 2
Author: Some Person
Author URI: http://example.org/me/
*/
/* Only load code that needs BuddyPress to run once BP is loaded and initialized. */
function my_plugin_init() {
require( dirname( __FILE__ ) . '/my-plugin.php' );
}
add_action( 'bp_include', 'my_plugin_init' );
/* If you have code that does not need BuddyPress to run, then add it here. */
Source: Checking For BuddyPress
Related Posts:
- How to get a buddypress user profile link and a certain user profile field for the current post author?
- How to Modify/Change a Buddypress/WordPress Account Activation Process
- BuddyPress: Adding a new tab in groups
- What’s the easiest way to change the default landing page for BuddyPress groups?
- How to re-enable admin bar with Buddypress active? (BP bar removed) [closed]
- How to ensure buddypress custome profile field is unique
- Posting Photos and Other Attachments in a BuddyPress Forum?
- How to check if the current page is a “personal activity”-page in buddypress? [closed]
- Redirect after registration in BuddyPress [closed]
- changing the signup button url in WPMU/Buddypress
- Buddypress profile pictures sync across WordPress Multisite Network
- Exclude User from Activity Stream in BuddyPress?
- Buddypress Fake (non-bot) Users [closed]
- Conditional based on the User Role of the Current Profile the user is viewing – BuddyPress [closed]
- BuddyPress | How to merge the “setting” & “profile” pages into one page? [closed]
- Upload files into buddypress profiles [closed]
- How do I find the bbpress forum ID for a forum in a buddypress group?
- How to make a Discussion Group ”Sticky” in BuddyPress [closed]
- Buddypress register.php user redirect [closed]
- How to add a count in a custom tab in a Buddypress group
- Show activities of defined BuddyPress groups [closed]
- Add an extra field to BuddyPress activity form
- How to create a theme specific translation of buddypress? [closed]
- Remove post content from buddypress activity [closed]
- BuddyPress Toolbar
- Buddypress Registartion template [closed]
- Does BuddyPress Have An Action Hook for remove_user? [closed]
- How to auto-accept a friend-request in buddypress based on user meta
- switch_to_blog( ) content disappears after load
- Buddypress bp_has_members function custom search with meta query [closed]
- Show Specific Buddypress Group Activity Stream in page template
- Buddypress, BBPress – deqeue bp, bbp css and get group member count
- buddypress activity social share
- Wrong path when adding custom tab in BuddyPress [closed]
- Empty “Forums” page BuddyPress site wide forums – bbPress [closed]
- How to set up WordPress in the intranet?
- Can I develop a social networking Site using WordPress and its Plugins? [closed]
- How to bring registration field to index page? [closed]
- Buddypress export Profile Fields [closed]
- Buddypress create custom tab on my profile and add on home page [closed]
- Integration of Cubepoints/Achievements
- BuddyPress/bbpress: There was an error when creating the topic
- Fire curl command everytime new user is created
- Save buddypress xprofile data to author meta
- How to get all logged in user id in buddypress [closed]
- bp_has_members with custom fields [closed]
- Pre-populate BuddyPress Member Profile Data in Gravity Forms [closed]
- conditional activity page for buddypress [closed]
- How to add an error or notification to an activity?
- BuddyPress user custom url structure , any one knows filter for bp_core_get_userlink [closed]
- Buddypress Welcome Email [closed]
- Buddypress – Add activity scope [closed]
- Buddypress get data from wp_bp_groups_members table [closed]
- Buddypress – adding profile fields to Group > Members directory [closed]
- How to send a BuddyPress user a notification on a plugin event? [closed]
- How to: get_user_meta – BuddyPress [closed]
- Where do I edit the user profile with Buddypress? [closed]
- Change Buddypress Activity Stream Date format [closed]
- how to find the current page is isngle activity page in buddypress? [closed]
- Buddypress: remove forum tab in user profile page? [closed]
- Noob Question – Buddypress Dynamic content on static page
- How do you remove the buddypress group avatar from the activity stream post? [closed]
- Using wp-postratings to rate user on profile pages [closed]
- How to remove ( 0, 0 ) from forum page in bbpress [closed]
- How to make the BuddyBar fix and scroll with the page
- BuddyPress redirecting to home page on login [closed]
- Buddypress integration with wordpress
- How to split out BuddyPress notifications drop down items to their own top level? [closed]
- Set default landing page for buddypress member profile
- bp_core_new_subnav_item shows new group tab but returns 404 when the tab runs. Works on another page
- Limit the total space in every user
- Return instead of echo
- permalink for group type
- Upload buddy press profile picture from custom page template
- How can I display list of notifications of buddypress in a single page or post
- Buddypress: Filter Members Based on If They Have Posts
- send reply message by thread id in buddypress
- Buddypress user registration validation not working with custom select query
- New accounts daily at WP Multi-User site under development, Analytics reports no traffic. What gives?
- How to get custom field from BuddyPress Extended Profile
- is it possible to add_action via template.php rather than function.php for this specific buddypress hook?
- disable plugin in specific dynamic buddypress pages
- Deregister script on specific user’s BuddyPress page
- Missing “Registration” page with BuddyPress [closed]
- How to add username in toolbar link?
- Some ways to debug code
- How to update avatar in buddypress programmatically? [closed]
- How to: When a bp Group created, automatically create a wp category [closed]
- Buddypress Adding a Nav item and Calling Custom Fields [closed]
- I used the Buddypress Message Compose to send a site wide email to all members wasnt sent tho [closed]
- Allowing users to add HTML to BP Groups Description how can I error check html of users? [closed]
- Weird google bot crawl problem
- Delete user account – If user has attachments uploaded then redirect (with a message) [closed]
- Add Sub Nav Menu Item to Buddy Press Menu [closed]
- Set maximum number of letters limit on xprofile fields [closed]
- Target “admins” with different styles on the front end [closed]
- BuddyPress – Message’s Send To auto-fill functionality not working
- Is There A List Of What Buddypress Template Files Go Where And What They’re To Be Renamed?
- Force buddypress groups to be private [closed]
- Remove user from group after X days buddypress