Yudi
Yudi

Reputation: 191

Remove 'Theme Options' Option Tree Wordpress

I use the Options Tree. Just to use a Meta Box only. And I do not use his Theme Options.

In the picture below, how to throw Theme Options menu? Is it possible?

enter image description here

Upvotes: 0

Views: 527

Answers (2)

Ateeq Rafeeq
Ateeq Rafeeq

Reputation: 58

/**
 * Option Tree Files
 * Including Files and setting up Option Tree
 *
 * @Since 1.0.0
 * Version 1.0.0
 */
if(class_exists('OT_Loader' )): 
            //Filter for option tree settings
    add_filter( 'ot_show_pages', '__return_false' );
    add_filter( 'ot_show_new_layout', '__return_false' );
    add_filter( 'ot_post_formats', '__return_true');
    add_filter( 'ot_use_theme_options', '__return_false' ); //This filter removes theme options page.
endif;

The code above is helpful to remove custom Theme options page from Option Tree, make sure you add this in functions.php

This code is helpful for people who want to just use Metaboxes of OptionTree plugin not the Theme options.

Upvotes: 0

michaelrmcneill
michaelrmcneill

Reputation: 1163

Add the following code to your functions.php file:

function remove_ot_menu () {
    remove_submenu_page( 'themes.php', 'ot-theme-options' );
}
add_action( 'admin_init', 'remove_ot_menu' );

This will remove the panel you want to remove.

Upvotes: 1

Related Questions