Restrict/remove classic/text tab in cornerstone pages/posts

Is there a way to restrict the classic or text tab when a page or post is made with Cornerstone?

We have published multiple websites for schools with homepages in Cornerstone. Some of the many editors who work with those websites try to edit the pages in the text mode. They ignore the warning of Cornerstone and mess up the layout.

Of course we can send bills to these people to repair their sites but a more friendly solution to prevent this in the future would be to remove the possibility for them to enter the text or classic mode (tab) while editing the page or post.

My question: is there such a plugin or code that restrict editors to enter the text-mode when a page is made with Cornerstone?

Hi There,

Thanks for writing in!

There is such setting to disable the text mode but you can disable the Visual mode for any specific user.
First, you need to visit Users » Your Profile page in the WordPress admin area. This is where you can edit your user profile in WordPress.

Under the visual editor, you need to check the box next to ‘Disable visual editor when writing’ option.

Don’t forget to click on the ‘Update Profile’ button to save your settings.

You can now edit a post or create a new one. You will notice that visual editor will not be available anymore.
Note: This setting will not affect other users registered on your WordPress site. You have to login from the user you want to disable it.

Hope this helps.

Thanks

Hello Basanta,

Thank you but then it is still possible to edit the page in text-mode.
Also it is not possible anymore to edit other pages (not created in Cornerstone) in the visual mode.

On many websites we have only 1, 2 or 3 pages created with Cornerstone. All others in ‘visual’. I want to exclude the possibility on the Cornerstone-pages to edit them in Text or in Visual. I don’t want to give the editor any possibility to edit the page in something else than Cornerstone. Only on these particularly pages.

Hi there,

You can insert a custom CSS to hide the Visual and Editor options in the page edit mode when the page is not built in Cornerstone. You can add this in the functions.php file of the child theme:

add_filter( 'admin_footer', 'hide_visual_text_options', 99); 

function hide_visual_text_options() { 
  echo '  <style type="text/css">
          .cornerstone-active #content-tmce, 
          .cornerstone-active #content-html {  
              display:none;
          }
          </style>';
}

I’ve tried it. The options are still visible in a Cornerstone page.

Hi There,

Thanks for your confirmation!

I tried the same code on my setup and it works fine!
Can you please send us your website details so that we can have a look what is happening in your setup.

Please provide following information:
Set it as Secure Note

  • Link to your site
  • WordPress Admin username / password
  • FTP credentials
    All the best!

See in post above

Hi There,

It works fine on your website too!

I have added the code to your child theme function file and all the cornerstone pages as disabled the text and visual editor.

Thanks

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.