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

Force TinyMCE editor's "Toolbar Toggle" to be automatically chosen & expanded

programmeradmin3浏览0评论

A common problem we have with new Wordpress installations and particularly new users, is that their "Toolbar Toggle" button is not selected by default, and therefore the second line of the editor icons don't show.

Is there a way to force this option to always be selected?

A common problem we have with new Wordpress installations and particularly new users, is that their "Toolbar Toggle" button is not selected by default, and therefore the second line of the editor icons don't show.

Is there a way to force this option to always be selected?

Share Improve this question edited Apr 18, 2020 at 16:00 T.Todua 5,8809 gold badges52 silver badges81 bronze badges asked Nov 19, 2015 at 7:40 pixelkickspixelkicks 3091 gold badge5 silver badges12 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 9

Add below function in your activated theme's functions.php file.

function changeMceDefaults($in) {

    // customize the buttons
    $in['theme_advanced_buttons1'] = 'bold,italic,underline,bullist,numlist,hr,blockquote,link,unlink,justifyleft,justifycenter,justifyright,justifyfull,outdent,indent';         
    $in['theme_advanced_buttons2'] = 'formatselect,pastetext,pasteword,charmap,undo,redo';

    // Keep the "kitchen sink" open
    $in[ 'wordpress_adv_hidden' ] = FALSE;
    return $in;
}
add_filter( 'tiny_mce_before_init', 'changeMceDefaults' );
发布评论

评论列表(0)

  1. 暂无评论