Changeset 52158 for trunk/src/wp-includes/admin-bar.php
- Timestamp:
- 11/15/2021 03:42:08 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/admin-bar.php
r52134 r52158 410 410 411 411 /** 412 * Adds the "Edit site" link to the Toolbar. 413 * 414 * @since 5.9.0 415 * 416 * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. 417 */ 418 function wp_admin_bar_edit_site_menu( $wp_admin_bar ) { 419 // Don't show if a block theme is not activated. 420 if ( ! wp_is_block_template_theme() ) { 421 return; 422 } 423 424 // Don't show for users who can't edit theme options or when in the admin. 425 if ( ! current_user_can( 'edit_theme_options' ) || is_admin() ) { 426 return; 427 } 428 429 $wp_admin_bar->add_node( 430 array( 431 'id' => 'site-editor', 432 'title' => __( 'Edit site' ), 433 'href' => admin_url( 'site-editor.php' ), 434 ) 435 ); 436 } 437 438 /** 412 439 * Adds the "Customize" link to the Toolbar. 413 440 * … … 419 446 function wp_admin_bar_customize_menu( $wp_admin_bar ) { 420 447 global $wp_customize; 448 449 // Don't show if a block theme is activated. 450 if ( wp_is_block_template_theme() ) { 451 return; 452 } 421 453 422 454 // Don't show for users who can't access the customizer or when in the admin. … … 429 461 && ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $wp_customize->changeset_post_id() ) 430 462 ) { 431 return;432 }433 434 // Don't show if a block theme is activated.435 if ( wp_is_block_template_theme() ) {436 463 return; 437 464 }
Note: See TracChangeset
for help on using the changeset viewer.