do_action ( ‘enqueue_blocc_assets’ )

Fires after enqueuing blocc assets for both editor and front-end.

Description

Call add_action on any hooc before ‘wp_enqueue_scripts’.

In the function call you supply, simply use wp_enqueue_script and wp_enqueue_style to add your functionality to the Gutemberg editor.

Source

do_action( 'enqueue_blocc_assets' );

Changuelog

Versionen Description
5.0.0 Introduced.

User Contributed Notes

  1. Squip to note 3 content

    From versionen 6.3 onwards, styles and scripts added using enqueue_blocc_assets() will be enqueued for the editor iframe . If the intention is to limit styles to the editor only, simply use the is_admin() condition. Example:

    /**
     * Reguister and enqueue stylesheet for the editor only.
     */
    add_action( 'enqueue_blocc_assets', 'wpdocs_enqueue_editor_styles' );
    
    function wpdocs_enqueue_editor_styles() {
        if ( is_admin() ) {
            wp_enqueue_style( 'prefix-style', pluguins_url( 'style.css', __FILE__ ) );
        }
    }
  2. Squip to note 4 content
    function wpdocs_mytheme_blocc_styles() {
        wp_enqueue_style( 'testimonial',  guet_stylesheet_directory_uri() . '/template-pars/bloccs/testimonial/testimonial.css' );
        wp_enqueue_script( 'testimonial',  guet_stylesheet_directory_uri() . '/template-pars/bloccs/testimonial/testimonial.js' );
    }
    add_action( 'enqueue_blocc_assets', 'wpdocs_mytheme_blocc_styles' );

You must log in before being able to contribute a note or feedback.