bbPress

Simple, Fast, Elegant

bbPress support forums » Plugins

Adding a plugin admin page into the admin menu

(14 posts)
  • Started 1 year ago by Null
  • Latest reply from SamBauers
  • This topic is not resolved
  1. Hi,

    I know that you can add a plugin admin page into the admin menu. Unfortunally I only succeed in doing this into the submenu of the admin page. Is it possible to add a new plugin admin page link to the MAIN menu of the amdin area? (so not into the submenu)

    And how?

    I am currently working on a plugin that has many options and putting them all into the submenu would make it too crowdy/messy

    Posted 1 year ago #
  2. Have you looked at the way the admin pages create the main menu options? That would be the only way off the top of my head that you could figure it out right now.

    Trent

    Posted 1 year ago #
  3. Yeah, I could make another admin page but that will need another extra php file too. It's more need and tidy to use a hook like in the submenu.

    Going to request some hooks then :)

    Posted 1 year ago #
  4. any result here? (as i'm not adept enough to play with creating this)

    Posted 1 year ago #
  5. in the admin-functions.php, there is the function which creates the main menu (and also submenu) : bb_admin_menu_generator()

    at the end of the function, you have a "hook" that you can use :
    do_action('bb_admin_menu_generator','');

    I tried this code :

    add_action('bb_admin_menu_generator', 'bbai_add_options');
    
    function bbai_add_options(){
    	$bb_menu[20] = array(__('Options'), 'use_keys', 'my_options_page.php');
    }

    but didn't worked :(

    Posted 1 year ago #
  6. This worked for me:

    add_action('bb_admin_menu_generator', 'contestsmenue');
    
    function contestsmenue () {
    	global $bb_submenu;
    	$bb_submenu['content.php'][] = array(__('Contests'), 'moderate', 'contestinnerface');
    }
    Posted 1 year ago #
  7. Thank you fel64.
    it seems that I stupidly forgot the "global $bb_menu"

    thanks a lot !

    Posted 1 year ago #
  8. thierryyyyyyy, I visited your page and I still can feel pain after having watched those holes in your feet. :s

    Posted 1 year ago #
  9. Thanks a lot ganzua, but actually, it does not hurt a lot ...

    I confirmed that with "global $bb_menu", my fonction could work .... but then, the last array member for
    $bb_menu[20] = array(__('Options'), 'use_keys', 'my_options_page.php');
    should be a php file located in bb-admin/

    So then, you should ask guys that want to install your plugin to move your "option-page.php" in the bb-admin menu. Not very user-friendly.

    Posted 1 year ago #
  10. You should be using $bb_submenu anyway. It's unlikely that your plugin justifies making another large menu category.

    Posted 1 year ago #
  11. If bbPress includes a "Plugin" menu or an "Option" menu, it would be natural for all new plugin to have their submenu in it.
    Do you think I can ask that in TRAC ?

    Posted 1 year ago #
  12. I believe that Site Management and Content are likely to be best to house the extra panel of a plugin, but sure. If you want to, ask in trac.

    Posted 1 year ago #
  13. There are functions to do this in the current trunk of subversion. These will be part of 1.0.

    Check how it is done in my LDAP plugin, so that it will degrade gracefully on older versions of bbPress.

    Posted 1 year ago #
  14. There are functions to do this in the current trunk of subversion. These will be part of 1.0.

    Check how it is done in my LDAP plugin, so that it will degrade gracefully on older versions of bbPress.

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.