I have this code
add_action('admin_enqueue_scripts', 'my_admin_scripts_method');
function my_admin_scripts_method() {
wp_enqueue_script('admin-control2', plugin_dir_url( __FILE__ ) .'js/admin_control.js',array(), PLUGIN_VERSION, true);
}
When I'm logged in /wp-admin with an user that is administrator the js file is enqueued. However if I switch to an user that is editor role the js file is not included.
How can i fix this ? Is this the default behavior ?
If you want my 2 cents i would say that your problem reside outside that piece of code. Be 100% sure that your code is getting executed no matter what the user lvl is. For example, move it in the main plugin file outside any class scope and see if it work