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?
- Import media to online WordPress from local development
- How to add a checkbox element to attachments editor with example
- Auto get_header and get_footer on every template?
- Theme Check gives: Required: This theme doesn’t seem to display tags?
- Is it possible to use line break in theme description?
- How does WordPress decide what template to use as frontpage
- Override Current Theme Setting in wp_config.php
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- WP Gutenberg custom block – generate theme colors from SASS and use them in the inspector and php callback
- Is tag default in WordPress?
- “Display Site Title and Tagline” checkbox not working?
- Getting jquery to work with custom theme
- How to retrieve an image from a post and display it before excerpt of a post? [duplicate]
- Why does WP recommend against custom favicon functionality in themes?
- Excluding a page with a certain name from wp_page_menu
- Widgets with groups / sub widgets? Widget in a widget?
- Avada resources still loading from localhost after database migration [closed]
- No Appearance –> Header menu
- Internationalization and functions that use it
- Update Custom Theme Version
- Storefront child theme not applying parent theme [closed]
- What can I use for small text when converting to WordPress?
- How to specify the “Main Sidebar” for a theme
- Integrate WooCommerce theme with a WordPress theme [closed]
- Automated Footer information
- How do you use WordPress for a website that’s not in a blog format?
- How to develop a menu like wwe.com?
- Add tags to pages
- Why set a second parameter in the translate function?
- Replace site title with logo when logo is uploaded in customizer using
- Admin login not working
- How to create query to get top 3 sticky/latest posts
- Fatal error: Class ‘ZipArchive’ not found
- Is it possible to determine when user is at “Media > Add New” vs “Post > Add an Image”
- Check if( selected() )
- Modify available templates (in dropdown)
- Change WordPress Resource URL
- Adding content inside the anchor tags within WordPress main nav
- Open portfolio image in light box
- Let visitors show/hide a type of content
- style variations hurt the editing performance
- how to create/register menu items that can be added to menus later
- Theme does not allow shortcodes
- What is an alternative to not using child theme to customize a WordPress theme?
- wpalchemy repeating fields dropdown issue
- Does WordPress require that your submitted theme supports multiple menu levels?
- Add Dynamic Sidebar to Exisiting WordPress Theme [closed]
- Why does the first loop take arguments from the second loop?
- Is there any reason that other theme elements (such as nav menus) shouldn’t be within the loop?
- Is there any way to show child theme in theme detectors?
- Is there any halfway decent documentation on the wp.media JS class?
- Setcookie not setting cookies anywhere except admin