File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,12 +19,14 @@ function render_block_core_template_part( $attributes ) {
1919 $ content = null ;
2020 $ area = WP_TEMPLATE_PART_AREA_UNCATEGORIZED ;
2121
22- if (
23- isset ( $ attributes ['slug ' ] ) &&
24- isset ( $ attributes ['theme ' ] ) &&
25- get_stylesheet () === $ attributes ['theme ' ]
26- ) {
27- $ template_part_id = $ attributes ['theme ' ] . '// ' . $ attributes ['slug ' ];
22+ if ( isset ( $ attribues ['theme ' ] ) ) {
23+ $ theme = $ attributes ['theme ' ];
24+ } else {
25+ $ theme = get_stylesheet ();
26+ }
27+
28+ if ( isset ( $ attributes ['slug ' ] ) ) {
29+ $ template_part_id = $ theme . '// ' . $ attributes ['slug ' ];
2830 $ template_part_query = new WP_Query (
2931 array (
3032 'post_type ' => 'wp_template_part ' ,
@@ -34,7 +36,7 @@ function render_block_core_template_part( $attributes ) {
3436 array (
3537 'taxonomy ' => 'wp_theme ' ,
3638 'field ' => 'name ' ,
37- 'terms ' => $ attributes [ ' theme ' ] ,
39+ 'terms ' => $ theme ,
3840 ),
3941 ),
4042 'posts_per_page ' => 1 ,
You can’t perform that action at this time.
0 commit comments