Changeset 38810 for trunk/src/wp-includes/admin-bar.php
- Timestamp:
- 10/18/2016 08:04:36 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/admin-bar.php
r38708 r38810 367 367 * 368 368 * @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance. 369 * @global WP_Customize_Manager $wp_customize 369 370 */ 370 371 function wp_admin_bar_customize_menu( $wp_admin_bar ) { 372 global $wp_customize; 373 371 374 // Don't show for users who can't access the customizer or when in the admin. 372 375 if ( ! current_user_can( 'customize' ) || is_admin() ) { … … 374 377 } 375 378 379 // Don't show if the user cannot edit a given customize_changeset post currently being previewed. 380 if ( is_customize_preview() && $wp_customize->changeset_post_id() && ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $wp_customize->changeset_post_id() ) ) { 381 return; 382 } 383 376 384 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 385 if ( is_customize_preview() && $wp_customize->changeset_uuid() ) { 386 $current_url = remove_query_arg( 'customize_changeset_uuid', $current_url ); 387 } 388 377 389 $customize_url = add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() ); 390 if ( is_customize_preview() ) { 391 $customize_url = add_query_arg( array( 'changeset_uuid' => $wp_customize->changeset_uuid() ), $customize_url ); 392 } 378 393 379 394 $wp_admin_bar->add_menu( array(
Note: See TracChangeset
for help on using the changeset viewer.