Make WordPress Core


Ignore:
Timestamp:
03/14/2024 08:57:48 AM (10 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.

Reviewed by gziolo.
Merges [57826] to the to the 6.5 branch.

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

Location:
branches/6.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.5

  • branches/6.5/src/wp-includes/interactivity-api/interactivity-api.php

    r57774 r57830  
    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.