I'm using the function below to load some javascript that removes the checkbox in the User Profile that is used to toggle the Visual Editor:
//Remove Visual Editor option in User Profile
function remove_visual_editor_admin_script( $hook ){
if ('user-edit.php' != $hook) {
return;
}
wp_enqueue_script( 'remove_visual_script', get_stylesheet_directory_uri().'/js/remove-visual-editor.js', array('jquery') );
}
add_action('admin_enqueue_scripts','remove_visual_editor_admin_script');
It loads a simple jQuery function in remove-visual-editor.js
that removes the HTML and CSS and hides the checkbox.
Problem is, the Visual Editor checkbox appears on two admin pages: one is user-edit.php
and the other is profile.php
; I'm calling the jQuery script on user-edit.php
above.
So I tried an array of page templates, like this
if (array('user-edit.php', 'profile.php') != $hook) {
with no luck.
How to I add the remove-visual-editor.js
to both 'user-edit.phpand
profile.php` pages?
Is there another way to add an array or multiple pages to the if
line?