Domanda

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 ?

enter image description here

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

È stato utile?

Soluzione

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' );
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a wordpress.stackexchange
scroll top