I am trying to build a wp plugin using vuejs and the bulma css framework, but it seems like it is having an impact on the whole admin area.
Is it possible to load my css only on my plugin admin page?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI am trying to build a wp plugin using vuejs and the bulma css framework, but it seems like it is having an impact on the whole admin area.
Is it possible to load my css only on my plugin admin page?
To answer the question, from the codex, listed above in the comments.
function load_custom_wp_admin_style($hook) {
// Load only on ?page=mypluginname
if($hook != 'toplevel_page_mypluginname') {
return;
}
wp_enqueue_style( 'custom_wp_admin_css', plugins_url('admin-style.css', __FILE__) );
}
add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' );
Note: If you are unsure what your $hook name is .. use this to determine your hookname. Put the code after the { from the function.
wp_die($hook);