Skip to content

Instantly share code, notes, and snippets.

@ucheng
Created September 29, 2016 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ucheng/e5f6822ca5842e9d5ae0b5a7cf45852a to your computer and use it in GitHub Desktop.
Save ucheng/e5f6822ca5842e9d5ae0b5a7cf45852a to your computer and use it in GitHub Desktop.
remove Avada mce button
<?php
add_filter('mce_buttons','prefix_tinymce_buttons', 12);
function prefix_tinymce_buttons($buttons) {
$user = wp_get_current_user();
if ( $user->roles[0] == 'administrator' ) {
return $buttons;
}
//Remove the text color selector
$remove = 'fusion_button';
//Find the array key and then unset
if ( ( $key = array_search($remove,$buttons) ) !== false )
unset($buttons[$key]);
return $buttons;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment