I’ll assume you’re calling it in your functions.php file?
If that’s the case, likely the plugin is adding the menu item after you’re call is being called. Try placing it in the admin_init() hook, at the very end.
if ( ! function_exists( 'remove_wp_menu_items' ) ) {
function remove_wp_menu_items() {
remove_submenu_page( 'themes.php', 'theme-editor.php' );
}
}
add_action( 'admin_init', 'remove_wp_menu_items', 999 );
http://codex.wordpress.org/Function_Reference/remove_submenu_page
http://codex.wordpress.org/Function_Reference/add_action
Related Posts:
- How to display conditional-content if wp_nav_menu( $args ) retruns something
- WordPress Quick Question . How to Get Parent Link in Submenu in My Code
- get_the_title() gets printed out twice
- How to use wp_nav_menu to create custom dropdown menu?
- Adding Additional Variables on Menus Page
- Show login greeting above sub-menu links?
- Remove submenu item from list
- Get Child of Child Pages in custom Menu
- How to give custom roles the capability to edit one Menu instead of every Menu
- Display specific main Sub Nav on Woocommerce product pages
- Beyond widget side menu editing, with the php page, custom template
- How I can add div to menu?
- wp_nav_menu prints children with parent name
- Submenu opened problem
- How to test nonce with AJAX – Plugin development
- What does $wpdb->get_row return?
- Can’t extend some core classes
- Change Navigation Bar based on logged in or not
- WP add_action factory
- wp_loaded hook block script enquequing
- Show comments menu in dashboard only if the site has comment
- WP nonce invalid
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- woocommerce subscriptions – get expiration date [closed]
- Same log message keeps on printing to debug.log file thousand of times
- Count top level menu items
- Adding Default Settings to Theme My Login plugin
- create a select input with menus created on a custom options page
- Custom filter in admin edit custom post type responding with invalid post type?
- WordPress Scheduled Event Request Blocking
- How can i upload images in an admin page?
- Append HTML Using Shortcode
- Delete a WordPress transient from a shortcode on Page/Post update
- Multiple WordPress Menus that will only display all pages
- Menu — How to add “current-menu-grand-ancestor” css class
- Input type search in Menu
- Plugin CSS not enqueing
- Create onClick Event to Re-load a Widget
- Swapping wp_dropdown_categories function with wp_category_checklist
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- Accessing the database from a plugin outside of action hooks
- WP Walker using custom css classes
- Adding subdomain to home_url for “add_menu_page”
- How to show phpinfo() only in a new tab?
- How to find error in my code when the error message is pointing to WP core file?
- How to select the contents in the text view textrea in wp_editor?
- Change list item content in menu navigation to add a child element with specific class
- How to access global variable $menu inside a class function
- Menu Limitations
- How can I Add a variable PHP in the Menu Nav
- Where to place PHP code that inserts (or doesn’t insert) menu item?
- Hide categories that are not used in the post type
- Automated Cart Update With Alert Box Each Time
- How can I remove a function that has been added to wordpress with add_filter?
- PHP Fatal error: Uncaught mysqli_sql_exception: Table doesn’t exist in wordpress/wp-includes/wp-db.php
- WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
- Adding an Avatar to the Top Nav Bar
- How to sanitize any integer input field in wordpress?
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- Automatically adding new post categories to menu
- Add data attribute to each li in menu
- WordPress ajax doesn’t display object method on jQuery .change() function
- Custom user login page by creating a plugin
- Singelton class does not work, multiple initialization on page reload
- Saving an array of dynamic repeater data as post_meta
- what is the best practice to add new field to an api route
- filter default query to show just selected level of child pages in wordpress
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- WordPress wpform plugin submit and get multiple checked value from checkbox [closed]
- How to upload a file to a folder named after the user_id via plugin
- Reprinting tags with all attributes
- Use custom post type for a store locator
- developing a wordpress plugin, have a few PHP Woocommerce related coding questions
- Remove metabox from WordPress menu editor page?
- Improve page speed loading using CDN and async or defer attribute
- How do I programmatically set a user as spam in BuddyPress? [closed]
- Custom Walker_Nav_Menu issue with variables on PHP 7.3
- How to use $_GET function WordPress backend
- Whitelisting items from custom options page
- Add_menu_page not displaying the menu in class based plugin
- How to call plugin function per site in a multisite?
- How to add an arrow to menu items has submenus
- Update results, Before deleting the related category [closed]
- How to make my custom widget appear within WordPress widgets? Plugin development
- Script to browser problem PHP
- wp_nav_menu returns menu list in ascending order. How can I arrange the menu same as dashboard menu
- adjust section according to country?
- How to auto fetch customer details in Woocommerce in checkout page
- Can’t upload image using media_sideload_image
- Store a default value for a transient on plugin activation
- Adding widgets to my plugin page instead of WordPress dashboard
- WP CRON duplicate wp_insert_post with has < and > tag
- How wp-cron can run in background if PHP is single threaded?
- How to insert data into database using wp cron job
- How to send Ajax request from my plugin in admin dashboard?
- I want to add custom add to cart link [closed]
- Options API get_option() and update_option() Not Correctly Updating or Returning
- Unique icons next to each WordPress menu item
- Execute long and heavy processes
- Child page menu in sidebar