Changeset 59910
- Timestamp:
- 03/03/2025 08:05:52 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/admin-bar.php
r59850 r59910 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 * 462 * @global string $_wp_current_template_id 461 * @since 6.8.0 Removed the query args to ensure that the link opens the starting screen of the Site Editor. 463 462 * 464 463 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. 465 464 */ 466 465 function wp_admin_bar_edit_site_menu( $wp_admin_bar ) { 467 global $_wp_current_template_id;468 466 469 467 // Don't show if a block theme is not activated. … … 472 470 } 473 471 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()) {472 // Don't show for users who can't edit theme options. 473 if ( ! current_user_can( 'edit_theme_options' ) ) { 476 474 return; 477 475 } … … 481 479 'id' => 'site-editor', 482 480 'title' => __( 'Edit Site' ), 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 ), 481 'href' => admin_url( 'site-editor.php' ), 491 482 ) 492 483 );
Note: See TracChangeset
for help on using the changeset viewer.