mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 07:36:58 +00:00
Patterns, Templates: Inject theme attr into Template Part blocks.
It was found that Template Part blocks were broken in the Site Editor, showing the `Template part has been deleted or is unavailable` message, due to a missing `theme` attribute. This bug seems to have been introduced by [56896], whose goal was to only inject that attribute into the markup returned by the templates and patterns REST API endpoints but not on the frontend, in order to improve performance. It has been demonstrated locally that reverting that changeset fixes the bug. Reverts [56896]. Props mmcalister, swisspidy, thelovelist, hellofromTonya, pbiron, Pauthake015, richtabor, nicolefurlan, huzaifaalmesbah, annezazu, kafleg, aegkr, sunitarai, shresthaaman, andraganescu, onemaggie, gziolo. Fixes #59629. git-svn-id: https://develop.svn.wordpress.org/trunk@56960 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -779,9 +779,7 @@ function make_before_block_visitor( $hooked_blocks, $context ) {
|
||||
* @return string The serialized markup for the given block, with the markup for any hooked blocks prepended to it.
|
||||
*/
|
||||
return function ( &$block, $parent_block = null, $prev = null ) use ( $hooked_blocks, $context ) {
|
||||
if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
|
||||
_inject_theme_attribute_in_template_part_block( $block );
|
||||
}
|
||||
_inject_theme_attribute_in_template_part_block( $block );
|
||||
|
||||
$markup = '';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user