Where to enqueue stylesheets for plugin?

Add this code in your main file: [plugin-name].php:

    function utm_user_scripts() {
            $plugin_url = plugin_dir_url( __FILE__ );

        wp_enqueue_style( 'style',  $plugin_url . "/css/style.css");
    }

    add_action( 'admin_print_styles', 'utm_user_scripts' );

So basically, you need to use ‘admin_print_styles’. At least it did the trick for me.

Leave a Comment