最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Remove 'Theme Options' Option Tree Wordpress

programmeradmin3浏览0评论

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?

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?

Share Improve this question edited Jul 15, 2014 at 17:15 fuxia 107k39 gold badges255 silver badges459 bronze badges asked Jul 9, 2014 at 22:13 YudiYudi 333 silver badges9 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 4

This can be removed using remove_submenu_page function. Put following codes in your functions.php

function remove_ot_menu () {
    remove_submenu_page( 'themes.php', 'ot-theme-options' );
}
add_action( 'admin_init', 'remove_ot_menu' );
/**
 * 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

发布评论

评论列表(0)

  1. 暂无评论