Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit b952b50

Browse files
authored
Fix 'Edit Mini Cart template part' link in WP 6.2 (#8574)
1 parent adbb66d commit b952b50

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/BlockTypes/MiniCart.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,21 @@ protected function enqueue_data( array $attributes = [] ) {
201201
current_user_can( 'edit_theme_options' ) &&
202202
wc_current_theme_is_fse_theme()
203203
) {
204-
$theme_slug = BlockTemplateUtils::theme_has_template_part( 'mini-cart' ) ? wp_get_theme()->get_stylesheet() : BlockTemplateUtils::PLUGIN_SLUG;
205-
$site_editor_uri = admin_url( 'site-editor.php' );
204+
$theme_slug = BlockTemplateUtils::theme_has_template_part( 'mini-cart' ) ? wp_get_theme()->get_stylesheet() : BlockTemplateUtils::PLUGIN_SLUG;
206205

207206
if ( version_compare( get_bloginfo( 'version' ), '5.9', '<' ) ) {
208207
$site_editor_uri = add_query_arg(
209208
array( 'page' => 'gutenberg-edit-site' ),
210209
admin_url( 'themes.php' )
211210
);
211+
} else {
212+
$site_editor_uri = add_query_arg(
213+
array(
214+
'canvas' => 'edit',
215+
'path' => '/template-parts/single',
216+
),
217+
admin_url( 'site-editor.php' )
218+
);
212219
}
213220

214221
$template_part_edit_uri = add_query_arg(

0 commit comments

Comments
 (0)