Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Example / Skeleton Admin options pane


azznonimous
Participant

@azznonimous

… Just the last comment, the add_action works fine this way (last line, moved from the bp-example-admin.php to bp-example.php):

function bp_example_check_installed() {
global $wpdb, $bp;

if ( !is_site_admin() )
return false;

/***
* If you call your admin functionality here, it will only be loaded when the user is in the
* wp-admin area, not on every page load.
*/
require ( WP_PLUGIN_DIR . '/bp-example/bp-example-admin.php' );

/* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
if ( get_site_option('bp-example-db-version') < BP_EXAMPLE_DB_VERSION )
bp_example_install();
}
add_action( 'admin_menu', 'bp_example_check_installed' );
add_action( 'admin_menu', 'bp_example_add_admin_menu' );

Skip to toolbar