@grosbouff
14 years, 10 months ago
Hi, i’m trying BP 1.2 under WPMU 2.9.1.
Got a problem here with my custom plugin when I try to add a page to the BuddyPress menu of the admin panel :
The syntax is
add_submenu_page(parent, page_title, menu_title, capability required, file/handle, [function]);
In the core, an example will be
add_submenu_page( ‘bp-general-settings’, __( ‘General Settings’, ‘buddypress’), __( ‘General Settings’, ‘buddypress’ ), ‘manage_options’, ‘bp-general-settings’, ‘bp_core_admin_settings’ );
But If I try to adapt this to my plugin
add_submenu_page( ‘bp-general-settings’, __(‘Classified3s %s’,’classified3s’), $name, ‘manage_options’, $bp->classified3s->slug, ‘classified3s_admin_settings’ );
It does not work.
The funtion classified3s_admin_settings() exists, and I’ve noticed that it’s when I change the file/handle parameter that it’s getting broken :
the URL become
/wp-admin/classified3s_admin_settings
instead of
/wp-admin/admin.php?page=classified3s_admin_settings
any idea ?
Okay, the solution was to initialize my plugin on the hook bp_init…
It’s working now.