Changeset 60194
- Timestamp:
- 04/28/2025 03:10:49 PM (3 weeks ago)
- Location:
- branches/6.8
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.8
-
branches/6.8/src/wp-includes/admin-bar.php
r59910 r60194 459 459 * @since 6.3.0 Added `$_wp_current_template_id` global for editing of current template directly from the admin bar. 460 460 * @since 6.6.0 Added the `canvas` query arg to the Site Editor link. 461 * @since 6.8.0 Removed the query args to ensure that the link opens the starting screen of the Site Editor. 461 * 462 * @global string $_wp_current_template_id 462 463 * 463 464 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. 464 465 */ 465 466 function wp_admin_bar_edit_site_menu( $wp_admin_bar ) { 467 global $_wp_current_template_id; 466 468 467 469 // Don't show if a block theme is not activated. … … 470 472 } 471 473 472 // Don't show for users who can't edit theme options .473 if ( ! current_user_can( 'edit_theme_options' ) ) {474 // Don't show for users who can't edit theme options or when in the admin. 475 if ( ! current_user_can( 'edit_theme_options' ) || is_admin() ) { 474 476 return; 475 477 } … … 479 481 'id' => 'site-editor', 480 482 'title' => __( 'Edit Site' ), 481 'href' => admin_url( 'site-editor.php' ), 483 'href' => add_query_arg( 484 array( 485 'postType' => 'wp_template', 486 'postId' => $_wp_current_template_id, 487 'canvas' => 'edit', 488 ), 489 admin_url( 'site-editor.php' ) 490 ), 482 491 ) 483 492 );
Note: See TracChangeset
for help on using the changeset viewer.