OOP Plugin and Menu – Call to undefined function register_setting()

WordPress documentation seems spotty on object-oriented code. I’m setting up a few plugins and the first should register settings and a menu page. It’s throwing “undefined” for the register_setting() or add_settings_field() calls. Should these go elsewhere? I’m not seeing the admin settings page get created either? Thanks for any help. <?php //$c = new mySettings(); … Read more

Highlighting a Menu Item by Post Name

With the help of a couple of users, my last two questions were highlighting a custom menu item through its ID. Now I’m trying to combine the code of the following two functions to make it work by Post Name: Add highlighting to new Admin Dashboard Menu Item add_action( ‘admin_menu’, ‘create_menu’ ); add_action( ‘admin_head-post.php’, ‘wpse_58567_highlight_menu_item’ … Read more

Hide Theme options and Customize Admin menu

Under the appearance admin menu, I have customizer added by the theme, and theme options added by a plugin. I’m using this code to hide both menus ( submenu’s of Appearance )for ALL admins apart from a certain USERNAME. function hide_menu() { global $current_user; $current_user = wp_get_current_user(); $user_name = $current_user->user_login; //check condition for the user … Read more

How do I alter the position of a Custom Post Type menu item within my plugin admin menu?

I’m writing a plugin (for the first time, so bear with me!) which includes a custom post type; ‘Programmes’. In the admin menu, I’ve set up a new menu group for the plugin, and I have the ‘Programmes’ menu item within that, along with some others. My problem is that the ‘Programmes’ item only seems … Read more

How to add taxonomy to Users menu in admin?

I want to create a taxonomy that is related to the users, therefore I’d like to show the taxonomy under “Users” menu within wordpress admin. In codex there’s a mention that you can attach taxonomy to “nav_menu_item” but I can’t find any working example of how this works. If I use: register_taxonomy( ‘expertise’, array( ‘nav_menu_item’ … Read more

Admin menu bar dropdown opens when I click on a form element (Chrome) [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 9 years … Read more

Is there any way to add absolute path for add_menu_page function?

I am creating a plugin for add menu option to WordPress admin and using below function for that: <?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); ?> But I would like to add absolute path for menu option in the place of $menu_slug. please see the screen shot, I have created both ” … Read more