When I enqueue a css style in a plugin like so:
function add_my_stylesheet()
{
wp_enqueue_style( 'myCSS', plugins_url( '/css/myCSS.css', __FILE__ ) );
}
add_action('init', 'add_my_stylesheet');
Is ‘init’ the correct action to use? It works fine. Is there any reason not to do it this way? Is this the standard way? I want to follow the best practices.
Thank you.
-Laxmidi
You can use
admin_print_styles
for your hook, this is the preferred method for adding a style to your plugin or admin page.