In this case, the issue is due to the queue order. You should change the priority of the execution of your add_action
hook to something large, to ensure that it executes as late as possible. add_action
‘s 3rd argument is the priority
represented by an integer. Lower #’s gain priority in execution over higher #’s.
add_action( 'admin_menu', 'remove_menus', 999999 );
It’s likely that the theme you’re trying to hide the options page for doesn’t have it’s execution priority that low and therefore the hook will have been created before your add action argument is fired.
Related Posts:
- Change admin bar to default:off
- Form Submitting Error with get_template_part()
- What is the right way to include a wp-admin file in your theme?
- How to change admin bar color scheme in MP6 / WP 3.8 front end?
- How to make a theme with more than one CSS file?
- Including CSS and JS on Admin Screen of Custom Theme Options
- How to customize wordpress login/register pages?
- Hide certain pages / posts on wp-admin, show custom filter
- Adding Content Areas to Custom Page Template
- Where is default wp_head() implemented?
- Can’t edit style.css in subdirectory of my theme?
- Why adding Categories does not auto refresh in Backend while using my custom theme?
- Enqueued Stylesheets Effecting Admin Styles
- Add social icons in a theme through custom admin menu
- How to regenerate thumbnails when they’re stored on S3
- Different Admin Theme – Based on Role?
- Display site admin profile fields in header.php
- Sub folder CSS that’s read by Admin panel
- wordpress custom theme import and export options for sample data [closed]
- how do you create an admin interface in plugin for your theme
- Warning/Error in Admin Panel while developing theme
- Administration Pages Styling
- Why is the Links Manager visible?
- How to make content editable from admin page?
- How can I display/hide certain content based on a Theme Option field?
- Is it possible to edit the styling of the admin panel from within a custom theme?
- How to add Bootstrap Tour JavaScript to WordPress Admin Panel Dashboard Widget
- Where can i design and modify a new mail template for sending emails to users when commenting?
- Can’t work out why widget contents disappear from admin
- How to create a custom template to admin dashboard
- How to add a button which saves the post then executes a function
- Permanently activate WordPress theme
- Add attachment for all images in post
- How to remove text “Log In” from login page
- Change the “Default Avatar” admin option via functions.php
- Can’t use admin_enqueue_scripts or wp_enqueue_script
- How to include a file only on dashboard widgets page?
- Thesis -style Navigation
- I’m using wp residence theme and want to display titile above the slider [closed]
- Iris color picker in custom theme option page not saving value
- Custom admin logo not showing after wordpress 4.5 upgrade
- How to remove permalinks links presents in each page of my site?
- show_option_none not working in meta box
- theme directory fallback image outputs url and not the image
- WordPress uploads do not show up and I see the white screen of death in some cases
- Create a variable with string, array or multiple values
- How to Disable Color Options?
- How do I make it super customisable?
- Menu items description? Custom Walker for wp_nav_menu()
- Organizing Code in your WordPress Theme's functions.php File?
- How to define and link full path to css located at a random folder on header.php
- Sizing screenshot.png without losing aspect ratio
- Software for WordPress Theme and Plugin Development? [closed]
- When to use is_home() vs is_front_page()?
- What is the preferred way to add custom javascript files to the site?
- What are the standard admin CSS id/class tags?
- Get the blog page URL set in Options
- How to remove admin menu pages inserted by plugins?
- How to create .pot files with POedit?
- How do I get the theme URL in PHP?
- Why when I submit a form in wordpress it loads a 404 page though URL is correct
- What is the constant WP_USE_THEMES for?
- Worthwhile to restrict direct access of theme files?
- How Do I Protect My Premium WordPress App Theme from Copying?
- How to detect mobile devices and present them a specific theme?
- Changing the Order of Admin Menu Sections?
- Using wp_add_inline_style without a stylesheet
- How to add posts to custom menus?
- WordPress Theme Preview Image
- How To extend WP_Customize_Control
- What is the difference between front-page.php and home.php? [duplicate]
- How can I get page slug
- Does the functions.php file ever get called during an AJAX call? Debug AJAX
- When to use _e and __ for the translation?
- What is a Theme textdomain?
- How to show a custom meta box on the “Quick Edit” screen?
- How to add CSS class to custom logo?
- Modal window from within WordPress admin
- How to add custom css file in theme?
- How important is it to enqueue a theme’s stylesheet?
- Placing a Custom Post Type Menu Above the Posts Menu Using menu_position?
- CSS not updating in browser when I change it
- Display Search Result Count
- Admin Page Redirect
- Disable dragging of meta boxes?
- wp_nav_menu(), how to change class?
- theme path in javascript file
- Is wp_is_mobile() effective?
- Display Menu Name using wp_nav_menu
- Making update notification functionality for my themes
- What questions do you ask when asked to give an estimate on theme development?
- How to remove dashicons.min.css from frontend?
- How do I remove a pre-existing customizer setting?
- Minimum Template Files for Theme Development
- Loading External Scripts in Admin but ONLY for a Specific Post Type?
- What’s the difference between home.php and index.php?
- pass object/JSON to wp_localize_script
- get_template_part vs action hooks in themes
- Theme Activate Hook
- Solutions for generating dynamic javascript / CSS