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 badges1 Answer
Reset to default 1Just 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' );
}