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

TinyMCE Visual Blocks plugin set Show blocks option for all users

programmeradmin1浏览0评论

I want the Show blocks feature of the TinyMCE Visual Blocks Plugin to be activated for all users.

I can activate the Show blocks feature under the View menu dropdown manually. See picture. This activates it for the current user.

How can I activate the feature for all users? Can it be done via the tiny mce before init hook similar to setting visualblocks_default_state ?

/docs/plugins/visualblocks/

I want the Show blocks feature of the TinyMCE Visual Blocks Plugin to be activated for all users.

I can activate the Show blocks feature under the View menu dropdown manually. See picture. This activates it for the current user.

How can I activate the feature for all users? Can it be done via the tiny mce before init hook similar to setting visualblocks_default_state ?

https://www.tiny.cloud/docs/plugins/visualblocks/ https://codex.wordpress/Plugin_API/Filter_Reference/tiny_mce_before_init

Share Improve this question asked Sep 9, 2019 at 17:42 Osvald LauritsOsvald Laurits 1337 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Just add this code to functions.php of your theme and then "View" --> "Show blocks" will always be enabled immediately when the page loads

if( !function_exists('custom_settings_tinymce') ){
  function custom_settings_tinymce($init) {

    $init['visualblocks_default_state'] = true;

    return $init;
  }
  add_filter('tiny_mce_before_init', 'custom_settings_tinymce' );
}
发布评论

评论列表(0)

  1. 暂无评论