Changeset 52158
- Timestamp:
- 11/15/2021 03:42:08 AM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/menu.php
r52069 r52158 213 213 'site-editor.php', 214 214 ); 215 216 $submenu['themes.php'][7] = array( 217 __( 'Styles' ), 218 'edit_theme_options', 219 'site-editor.php?styles=open', 220 ); 215 221 } 216 222 -
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 } -
trunk/src/wp-includes/class-wp-admin-bar.php
r51876 r52158 643 643 add_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 ); 644 644 add_action( 'admin_bar_menu', 'wp_admin_bar_site_menu', 30 ); 645 add_action( 'admin_bar_menu', 'wp_admin_bar_edit_site_menu', 40 ); 645 646 add_action( 'admin_bar_menu', 'wp_admin_bar_customize_menu', 40 ); 646 647 add_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 50 ); -
trunk/src/wp-includes/post.php
r52145 r52158 341 341 'edit_item' => __( 'Edit Template' ), 342 342 'view_item' => __( 'View Template' ), 343 'all_items' => __( ' AllTemplates' ),343 'all_items' => __( 'Templates' ), 344 344 'search_items' => __( 'Search Templates' ), 345 345 'parent_item_colon' => __( 'Parent Template:' ), … … 357 357 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 358 358 'has_archive' => false, 359 'show_ui' => false,360 'show_in_menu' => false,359 'show_ui' => wp_is_block_template_theme(), 360 'show_in_menu' => 'themes.php', 361 361 'show_in_rest' => true, 362 362 'rewrite' => false, … … 400 400 'edit_item' => __( 'Edit Template Part' ), 401 401 'view_item' => __( 'View Template Part' ), 402 'all_items' => __( ' AllTemplate Parts' ),402 'all_items' => __( 'Template Parts' ), 403 403 'search_items' => __( 'Search Template Parts' ), 404 404 'parent_item_colon' => __( 'Parent Template Part:' ), … … 416 416 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 417 417 'has_archive' => false, 418 'show_ui' => false,419 'show_in_menu' => false,418 'show_ui' => wp_is_block_template_theme(), 419 'show_in_menu' => 'themes.php', 420 420 'show_in_rest' => true, 421 421 'rewrite' => false,
Note: See TracChangeset
for help on using the changeset viewer.