I think you’ll find it does exist and is how plugins are meant to work by first checking that BP is loaded?
It might be easier if you explained what you’re trying to achieve rather than the approach you would like to take to achieving it, then someone will be able to, possibly, provide an alternative method to achieving your requirement. It’s possibly a slightly confusing request as surely with BP not activated, no BP theme running why would any WP theme files need to be checking to see if BP is running?
You are right, I should have explained.
I am making theme both compatible for WP and BP by using something like this
<?php if (get_option(‘gangmei_switch_platform’) == ‘buddypress’) { ?>
<?php include(TEMPLATEPATH . ‘/_inc/member-search.php’); ?>
<?php } else { include(TEMPLATEPATH . ‘/_inc/search-form.php’); } ?>
This work 100%
( If buddypress is enable from theme option page, it will show the buddypress member search form
else it will show the wordpress search form)
But i want something like I said.
Then do either of these not serve the purpose?
defined( ‘BP_VERSION’ )
did_action( ‘bp_init’ )
Thanks for the info. I have not use defined( ‘BP_VERSION’ )
Where will be the proper place to put this code?
Won’t it load slower if we add defined( ‘BP_VERSION’ ) did_action( ‘bp_init’ ) function
Use:
if (defined(‘BP_VERSION’ ) { your code here;}
else { your non-bp code here;}
@r-a-y Thank a million for the tip. you saved my day
I think my style is better. Even if buddypress is enabled, I can still control it from the theme option page- what to display