Title: Resolution for BP_VERSION issue
Last modified: August 31, 2016

---

# Resolution for BP_VERSION issue

 *  [Garrett Hyder](https://wordpress.org/support/users/garrett-eclipse/)
 * (@garrett-eclipse)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/resolution-for-bp_version-issue/)
 * Hello,
 * As others have with this plugin I ran into an issue with BP_VERSION being undefined
   in the loader.php;
    `Notice: Use of undefined constant BP_VERSION - assumed '
   BP_VERSION' in .../wp-content/plugins/buddypress-notifications-manager/loader.
   php on line 117`
 * Other relevant tickets;
    [https://wordpress.org/support/topic/broken-on-buddypress-18?replies=2](https://wordpress.org/support/topic/broken-on-buddypress-18?replies=2)
   [https://wordpress.org/support/topic/use-of-undefined-constant-bp_version?replies=3](https://wordpress.org/support/topic/use-of-undefined-constant-bp_version?replies=3)
 * This is caused by the BuddyPress constants not being defined yet during the execution
   of this plugin. This can be corrected by following these instructions
    [https://codex.buddypress.org/plugindev/checking-buddypress-is-active/](https://codex.buddypress.org/plugindev/checking-buddypress-is-active/)
 * Basically we want to wrap the BP_VERSION check in an initialize function that’s
   executed via the bp_include hook so as to ensure the BuddyPress constants are
   defined. See example;
 *     ```
       function bp_notifications_manager_initialize() {
       	//if is not bp 1.5
       	if ( version_compare( BP_VERSION, '1.5' ) < 0 )
       		add_action( 'wp', 'bp_notifications_manager_subnav');
       	else
       		add_action( 'bp_setup_nav', 'bp_notifications_manager_subnav' );
   
       	// load text domain for the plugin
       	if ( file_exists( BP_NOTIFICATIONS_MANAGER_PLUGIN_DIR . '/languages/' . get_locale() . '.mo' ) )
       		load_textdomain( 'bp-notifs-manager', BP_NOTIFICATIONS_MANAGER_PLUGIN_DIR . '/languages/' . get_locale() . '.mo' );
       }
       add_action( 'bp_include', 'bp_notifications_manager_initialize' );
       ```
   
 * I created a fork of the github plugin that can be found here;
    [https://github.com/garrett-eclipse/buddypress-notifications-manager](https://github.com/garrett-eclipse/buddypress-notifications-manager)*
   Started a pull request to prompt a plugin update.
 * Hope this helps others,
    Cheers
 * [https://wordpress.org/plugins/buddypress-notifications-manager/](https://wordpress.org/plugins/buddypress-notifications-manager/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [Garrett Hyder](https://wordpress.org/support/users/garrett-eclipse/)
 * (@garrett-eclipse)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/resolution-for-bp_version-issue/#post-7015679)
 * Pull Request – [https://github.com/messaoudi-mounir/buddypress-notifications-manager/pull/1](https://github.com/messaoudi-mounir/buddypress-notifications-manager/pull/1)

Viewing 1 replies (of 1 total)

The topic ‘Resolution for BP_VERSION issue’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/buddypress-notifications-manager_767676.
   svg)
 * [Buddypress Notifications Manager](https://wordpress.org/plugins/buddypress-notifications-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/buddypress-notifications-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/buddypress-notifications-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/buddypress-notifications-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/buddypress-notifications-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/buddypress-notifications-manager/reviews/)

## Tags

 * [constant](https://wordpress.org/support/topic-tag/constant/)
 * [defined](https://wordpress.org/support/topic-tag/defined/)

 * 1 reply
 * 1 participant
 * Last reply from: [Garrett Hyder](https://wordpress.org/support/users/garrett-eclipse/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/resolution-for-bp_version-issue/#post-7015679)
 * Status: not resolved