How to remove admin submenu options from GridMarket theme

I'm looking to remove the Gridmarket submenus for background, header and theme options from the Appearance admin menu.

I'm using the code below to remove other submenu items but don't know what the [X] is for the three options I've listed above:

remove_submenu_page('themes.php', '[X]');

Please let me know if there's a better way to remove these options.

  • Tammie

    That function is more a 'kill entire section' ie:

    <?php
    
    add_action( 'admin_init', 'adjust_the_wp_menu' );
    function adjust_the_wp_menu()
    {
    	remove_submenu_page( 'themes.php', 'theme-editor.php' );
    }
    
    ?>

    It's not designed to remove 'under' so easily.

    If you want headers and other things removed you need to look in functions.php where you see custom headers, background being added. In your child theme for all people to use you'd call the function and just remove each there.

    if ( ! function_exists( 'framemarket_setup' ) ) :
    function framemarket_setup() {

    Now... you may also want to consider plugin options to this let me tag in some of the support staff to see if they have a suggestion that is less of a coding nightmare.

  • Alex

    As an example, if I wanted to remove the Theme Options submenu, it looks like it's defined in options.php as:

    <?php

    add_action( 'admin_init', 'framemarket_options_init' );
    add_action( 'admin_menu', 'framemarket_options_add_page' );

    // set up options and validate
    function framemarket_options_init(){
    register_setting( 'framemarket_options', 'framemarket_theme_options', 'framemarket_options_validate' );
    }

    // create menu page
    function framemarket_options_add_page() {
    add_theme_page( __( 'Theme Options' ), __( 'Theme Options' ), 'edit_theme_options', 'theme_options', 'framemarket_options_create_page' );
    }

    What's the right function to include in a plug-in to remove the page?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.