Make WordPress Core


Ignore:
Timestamp:
03/13/2024 10:46:53 AM (2 months ago)
Author:
swissspidy
Message:

Interactivity API: Increase hook priority for processing directives.

Use a priority of 100 to ensure that other filters can add additional directives before the processing starts.
This way, directives will be processed even if the $parsed_block variable is edited by a filter.

Props cbravobernal, swissspidy, flixos90, joemcgill, gziolo.
Fixes #60743.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/interactivity-api/interactivity-api.php

    r57774 r57826  
    5858
    5959            /*
    60              * Uses a priority of 20 to ensure that other filters can add additional
     60             * Uses a priority of 100 to ensure that other filters can add additional
    6161             * directives before the processing starts.
    6262             */
    63             add_filter( 'render_block_' . $block_name, $process_interactive_blocks, 20, 2 );
     63            add_filter( 'render_block_' . $block_name, $process_interactive_blocks, 100, 2 );
    6464        }
    6565    }
     
    6767    return $parsed_block;
    6868}
    69 add_filter( 'render_block_data', 'wp_interactivity_process_directives_of_interactive_blocks' );
     69/*
     70 * Uses a priority of 100 to ensure that other filters can add additional attributes to
     71 * $parsed_block before the processing starts.
     72 */
     73add_filter( 'render_block_data', 'wp_interactivity_process_directives_of_interactive_blocks', 100, 1 );
    7074
    7175/**
Note: See TracChangeset for help on using the changeset viewer.