Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Question for SamBauers about the menu generator function


Sam Bauers
Participant

@sambauers

I think the answer to all your questions is no. : )

I only pointed to the LDAP plugin for an example of processing a form in the admin area.

If you want to re-use the same function for all admin pages then you have to create functions that call the main function. E.g.

add_action( 'bb_admin_menu_generator', 'myplugin_add_admin_page' );

function myplugin_add_admin_page() {
bb_admin_add_menu(__('My plugin'), 'use_keys', 'myplugin');
bb_admin_add_submenu(__('My plugin sub menu item one'), 'use_keys', 'myplugin_one', 'myplugin');
bb_admin_add_submenu(__('My plugin sub menu item two'), 'use_keys', 'myplugin_two', 'myplugin');
}

function myplugin_base($number)
{
echo 'hello admin ' . $number;
}

function myplugin_one()
{
myplugin_base('one');
}

function myplugin_two()
{
myplugin_base('two');
}

I think that’s what you are asking anyway.

Skip to toolbar