Plugin Fatal error: Call to undefined function bp_is_active()
-
Hi,
I followed the Developer Resources → Group Extension API Example trying to create a custom group tab.
Unfortunately, I get a Fatal error: Call to undefined function bp_is_active() when trying to activate my plugin. (WordPress 4.9.4 buddypress Version 2.9.3)
What am I missing? I placed the myPlugin.php in a folder …/plugins/myPlugin
<?php /* Plugin Name: myPlugin Description: lalala. Tags: buddypress Version: 0.1 Author: Caro Zett License: GPL2 */ // Exit if accessed directly. defined( 'ABSPATH' ) || exit; ?> <?php /* Copyright 2018 Caro Z This program is free software; ... */ ?> <?php /* Only load code that needs BuddyPress to run once BP is loaded and initialized. */ function my_plugin_init() { require( dirname( __FILE__ ) . '/myPlugin.php' ); } add_action( 'bp_include', 'my_plugin_init' ); /** * The bp_is_active( 'groups' ) check is recommended, to prevent problems * during upgrade or when the Groups component is disabled */ if ( bp_is_active( 'groups' ) ) : ...
Please feel free to advise on “obvious” stuff as well, this is my first plugin 🙂
Thanks
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- You must be logged in to reply to this topic.