WordPress.org

Ready to get started?Download WordPress

Forums

How to add hidden options page in admin panel? (6 posts)

  1. Looimaster
    Member
    Posted 2 years ago #

    All these functions attach options page to left menu:

    add_menu_page(), remove_menu_page(), add_submenu_page(), remove_submenu_page(), add_dashboard_page(), add_posts_page(), add_media_page(), add_links_page(), add_pages_page(), add_comments_page(), add_theme_page(), add_plugins_page(), add_users_page(), add_management_page(), add_options_page()

    I want to create an options page for top admin bar (not just custom link). How to do that?

  2. s_ha_dum
    Member
    Posted 2 years ago #

    Those admin-bar 'pages' are just shortcuts to the admin pages that also show up on the left. I don't know that you can add a functioning wp-admin options page to the admin-bar without also adding it to the menu on the left, but you can add links and other items to the admin-bar.

    http://wp-snippets.com/addremove-wp-admin-bar-links/

    http://wordpress.org/support/topic/quotes-in-the-admin-bar?replies=10

  3. Looimaster
    Member
    Posted 2 years ago #

    Okay, I understand.

    Is there any way to hide it from left menu? But I want it to be still accessible by administrator. I just want it to be only no top if possible.

  4. s_ha_dum
    Member
    Posted 2 years ago #

    You could probably hide the left sidebar menu using CSS. It would still be there but wouldn't be visible. Really, why do you need to hide it though? If you register the menu with the correct permissions, only the administrator(s) will see it.

  5. Looimaster
    Member
    Posted 2 years ago #

    Thanks! I need to hide it for aesthetic purposes. I just need to move one menu to admin bar but I don't need this one on the left side at all.

    "If you register the menu with the correct permissions, only the administrator(s) will see it."

    - I think that's true for all placements anyway.

    Aren't there any other ways to hide it? Like using "add_options_page()" but without location specified or something like that.

  6. s_ha_dum
    Member
    Posted 2 years ago #

    - I think that's true for all placements anyway.

    Yes.

    You can't register an administrative page without specifying a 'location'. You might be able to hook a function to one or more of the admin actions or filters and manipulate the arrays used in creating those menus without actually destroying the functionality of the page, but I haven't done it so I can't tell you how to do it. And it is one of those things that I'd consider fraught with danger anyway.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.