+ if ( current_theme_supports( 'custom-background' ) ) {
+ $wp_admin_bar->add_menu( array(
+ 'parent' => 'appearance',
+ 'id' => 'background',
+ 'title' => __( 'Background' ),
+ 'href' => admin_url( 'themes.php?page=custom-background' ),
+ 'meta' => array(
+ 'class' => 'hide-if-customize',
+ ),
+ ) );
+
+ if ( current_user_can( 'customize' ) ) {
+ $wp_admin_bar->add_menu( array(
+ 'parent' => 'appearance',
+ 'id' => 'customize-background',
+ 'title' => __( 'Background' ),
+ 'href' => add_query_arg( urlencode( 'autofocus[control]' ), 'background_image', $customize_url ), // urlencode() needed due to #16859
+ 'meta' => array(
+ 'class' => 'hide-if-no-customize',
+ ),
+ ) );
+ }
+ }
+
+ if ( current_theme_supports( 'custom-header' ) ) {
+ $wp_admin_bar->add_menu( array(
+ 'parent' => 'appearance',
+ 'id' => 'header',
+ 'title' => __( 'Header' ),
+ 'href' => admin_url( 'themes.php?page=custom-header' ),
+ 'meta' => array(
+ 'class' => 'hide-if-customize',
+ ),
+ ) );
+
+ if ( current_user_can( 'customize' ) ) {
+ $wp_admin_bar->add_menu( array(
+ 'parent' => 'appearance',
+ 'id' => 'customize-header',
+ 'title' => __( 'Header' ),
+ 'href' => add_query_arg( urlencode( 'autofocus[control]' ), 'header_image', $customize_url ), // urlencode() needed due to #16859
+ 'meta' => array(
+ 'class' => 'hide-if-no-customize',
+ ),
+ ) );
+ }
+ }