Make WordPress Core


Ignore:
Timestamp:
02/12/2024 01:13:38 PM (3 months ago)
Author:
Bernhard Reiter
Message:

Block Hooks: Inject hooked blocks into modified templates and parts.

Using the new technique introduced in [57157] of using a metadata.ignoredHookedBlocks attribute in the anchor block to store information about whether or not a hooked block should be considered for injection, extend said injection to encompass modified templates and parts.

Fixes #59646.
Props gziolo, matveb.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/block-templates/base.php

    r54269 r57594  
    4040                'post_name'    => 'my_template',
    4141                'post_title'   => 'My Template',
    42                 'post_content' => 'Content',
     42                'post_content' => '<!-- wp:heading {"level":1} --><h1>Template</h1><!-- /wp:heading -->',
    4343                'post_excerpt' => 'Description of my template',
    4444                'tax_input'    => array(
     
    5858                'post_name'    => 'my_template_part',
    5959                'post_title'   => 'My Template Part',
    60                 'post_content' => 'Content',
     60                'post_content' => '<!-- wp:heading {"level":2} --><h2>Template Part</h2><!-- /wp:heading -->',
    6161                'post_excerpt' => 'Description of my template part',
    6262                'tax_input'    => array(
Note: See TracChangeset for help on using the changeset viewer.