Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Antoine Greuzard

    (@agreuzard)

    Thanks, i forgot to show my final solution to eliminate all css load by the_flexible() function:

    function layout_get($content): void {
    foreach ($contenus as $layout) {
    foreach ($layout['layouts'] as $value) {
    $handle = acf_slugify($layout['name']) . '-layout-' . acf_slugify($value['name']);
    // prevent acf automatic style enqueue
    wp_register_style($handle, false);
    wp_register_style($handle, false);
    wp_register_script($handle, false);
    wp_register_script($handle, false);
    }}}
    
    // Remove styles in front only
    add_action('wp_enqueue_scripts', function () {
    layout_get(acf_get_fields('group_xxxx'));
    });
    Thread Starter Antoine Greuzard

    (@agreuzard)

    Hello,

    Thanks!

    Its work with “-” not “_” like:

    add_action('wp_enqueue_scripts', 'my_enqueue_scripts');
    function my_enqueue_scripts() {
    	// prevent acfe automatic style enqueue
    	wp_register_style('titre-sous-le-header-layout-titre-fond-couleur', false);
    	wp_register_style('titre-sous-le-header-layout-titre-fond-couleur', false);
    }

    Have a great day!

Viewing 2 replies - 1 through 2 (of 2 total)