Try adding a filter instead. See this answer for more details
add_filter('admin_menu', 'admin_menu_filter',500);
function admin_menu_filter(){
if (! is_admin()){
remove_submenu_page( 'themes.php', 'background.php');
}
}
Also double check your link to the page from the admin menu. More details in the WordPress Codex
To remove a settings page for plugins that use a slug like /wp-admin/options-general.php?page=certain-plugin-settings use this code:….remove_submenu_page( ‘options-general.php’, ‘certain-plugin-settings’ );
Related Posts:
- How to create a theme customizer ‘sub’ panel?
- Different customizer previewUrls per section
- Add/remove controls dynamically based on other settings in Customizer
- Add custom background to div in home page
- How do I handle the “WP_Customize_Cropped_Image_Control” callback?
- Appearance->Editor not visible
- Add a “loading” notice when Customizer is making changes
- Make Theme Options Native to Theme Customizer
- Internalize get_theme_mod CSS Into Stylesheet?
- How to get control choices from $setting object passed to sanitize_callback
- Can I change a control’s transport in Customizer depending on the previewed page?
- How to output WP_Customize_Cropped_Image_Control setting?
- How to hook on customizer section expanded/active/opened event?
- How to hide few theme customization options – TwentySeventeen theme
- Panel description in Customizer does not show up
- How to extend Customizer payload sent when ‘Save & Publish’ is triggered
- Does the customizer support multiple templates?
- New customizer setting not showing value
- Removing pre existing menu item
- Hide Theme options and Customize Admin menu
- Customizer Add Section argument ‘active_callback’ => “is_front_page” not working
- Change the location of add_theme_support( ‘custom-header’ ) in the customizer
- Customizer: Update Preview instantly when typing into a number input field
- making customizer sections sortable but items not getting sorted first time items are moved
- Create custom control for WordPress customizer using JavaScript
- How do I add a customizer control dynamically?
- Can i use the same sanitize function on multiple theme mod textboxes?
- Need a help on sanitization
- Make customizer controls get custom setting type value
- Background Color not being set in WP Customizer
- How to disable cropping of the site icon?
- How do I update the wpColorPicker palette after initialization?
- Custom switch not hiding sub-fields on Customizer’s load
- WordPress Customizer Selective Refresh: works only on first setting change
- Selective refresh and registering widget areas
- How to use WP_Customize_Cropped_Image_Control settings in the customizer preview?
- How to use Vuejs inside a custom control?
- WordPress Customizer: Why widgets and nav_menus are components, not panel or section?
- Creating Dependant Text field in Customizer with Checkbox
- Customizer Ajax
- Add post type titles in customizer dropdown list
- How to make a Customizer partial force full refresh instantly?
- get_theme_mod filter ignores sanitize_callback
- DIVI Theme customizer changes not applied on existing pages [closed]
- Place a message in theme customizer sidebar
- Function has_custom_logo when used in Customizer
- Trouble creating custom sanitization function for user list dropdown
- WordPress Include ‘print_f’ in WP_Customize_Control array [closed]
- Output foreach loop used in WordPress wp_customize
- Changing Customizer Select To Checbox, But Retaining Classes
- Override theme style rule in Gutenberg
- How to add custom classes to the customizer panels, sections or controls?
- Theme Check plugin error when I add ‘©’ [closed]
- doubble scroll bar on wordpress home page [closed]
- Theme Customize API Panel Concept
- Detect device change (desktop, tablet or mobile) in Customizer
- Kirki: generate toggles for each taxonomy term
- Custom Customizer setting only saving value of 0
- Allow multiple settings to be stored in a single option in Theme customizer
- How to make WordPress customizer to autoload changes?
- Theme customizer not working
- When deleting a theme, are the theme customizer settings also deleted from the database?
- Get WordPress page Id inside customizer
- How to Add new Arguments to custom Control of customizer wordpress?
- where to change text for header?
- Theme Customizer for only author.php (per user baisi)
- Customizer API – Class doesn’t exist error
- Get register wp_customize settings in the front end
- Customizer List of Items
- Prevent WordPress from setting src on image added in Customiser
- How would you set Theme Customizer API Previewer Preview URL of a Logged out Page or Login Screen
- Sanitize callback function for select controll in customizer
- Defining path of content folder in WP-config solves the issue of missing header, footer, theme options. Is this a good approach? Expert Advice needed
- Creating a WordPress Customizer control/field with react
- How to save theme customizer values as sub-array?
- Change a customizer control based on another control’s value dynamically
- Linking to a Customizer control
- Image Uploaded To Customizer Not Displaying
- How to add a link to an external website in the description of a customizer control (with Kirki)?
- Can I fake being in the customizer?
- Domain redirect seems to break WP customizer
- Top header to edit page not present in one page
- Using different header images for different devices
- WordPress Customizer not allowing menu options
- Edit style.css via theme customizer
- Customizer Get Control Choices on Change
- How to implement Selective Refresh within posts?
- Why my first new WP_Customize_Image_Control doesn’t work
- How to add a Visual Edit Shortcut to a theme mod?
- Return customizer setting value in functions.php
- HTML inside Customizer
- Let user select file in customizer
- Customizer_register not saving custom setting to database
- Disabling and enabling content using Customizer
- How to tell theme customizer to save setting in my option table?
- I am looking for a font used in WordPress [closed]
- How to rename and rearrange multiple sections in the Customizer?
- What is a suitable sanitize_callback for logo image in Customizer?
- Remove Astra Customizer Panels [closed]
- How to access files outside /var/www/html