Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter limitlessventas

    (@limitlessventas)

    No one :(?

    Just point me in the right direction please.
    Thanks!:

    Plugin Author Andrew Ozz

    (@azaozz)

    I know that this can be easily done with mce_buttons and mce_buttons hooks.

    The thing is that I want to hide the buttons from an specific role

    Check if the current user has that specific role and then remove the buttons?

    Thread Starter limitlessventas

    (@limitlessventas)

    I hired someone from fiverr to make it for me. Im not in my computer now but if someone wants the code just let me know and I will post it here.

    Hi,

    Could you please post your code here regarding hide buttons for a specific role?

    Thank you

    RickHN

    (@rchinchilla)

    Hi @paulabarreto,@limitlessventas…

    try this code in your functions.php (better if have a child theme), its working for me.

    
    //*******************************************************
    if( !current_user_can('Super Admin') ) {  // change the role you want instead of Super Admin
    
    	add_filter("mce_buttons", "tinymce_editor_buttons", 99); 
    	
    	function tinymce_editor_buttons($buttons) {
    	
                   // HERE NEXT ADD OR REMOVE THE BUTONS YOU WANT
    		return array(
    		    "undo", 
    		    "redo", 
    		    "separator",
    		    "bold", 
    		    "italic", 
    		    "underline", 
    		    "strikethrough", 
    		    	"bullist",
    			"numlist",
    			"blockquote",
    			"justifyleft",
    			"justifycenter",
    			"justifyright",
    			"wp_more",
    			"spellchecker",
    			"wp_fullscreen",
    			"wp_adv",
    			"separator",
    		    //add more here...
    		    );
    	
    	}
    	
    }
    // ***********************************
    

    Good luck!!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Remove all the buttons from visual editor’ is closed to new replies.