WordPress.org

Make WordPress Core

Changeset 20918


Ignore:
Timestamp:
05/25/2012 10:26:00 PM (8 years ago)
Author:
koopersmith
Message:

Hide 'Customize' toolbar item when customizer is not supported. fixes #20751, see #19910.

Removes script queue check for 'customize-loader' from wp_customize_support_script(), because we may want to check for customize-support on a page without the loader.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-header.php

    r20893 r20918  
    100100</script>
    101101
    102 <?php wp_customize_support_script(); ?>
     102<?php
     103// If the customize-loader script is enqueued, make sure the customize
     104// body classes are correct as early as possible.
     105if ( wp_script_is( 'customize-loader', 'queue' ) )
     106    wp_customize_support_script();
     107?>
    103108
    104109<div id="wpwrap">
  • trunk/wp-includes/admin-bar.php

    r20666 r20918  
    577577        return;
    578578
    579     $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'customize', 'title' => __('Customize'), 'href' => wp_customize_url(get_stylesheet()) ) );
     579    $wp_admin_bar->add_menu( array(
     580        'parent' => 'appearance',
     581        'id'     => 'customize',
     582        'title'  => __('Customize'),
     583        'href'   => wp_customize_url(get_stylesheet()),
     584        'meta'   => array(
     585            'class' => 'hide-if-no-customize',
     586        ),
     587    ) );
     588    add_action( 'wp_before_admin_bar_render', 'wp_customize_support_script' );
    580589
    581590    if ( current_theme_supports( 'widgets' )  )
  • trunk/wp-includes/css/admin-bar.dev.css

    r20814 r20918  
    583583
    584584/**
     585 * Customize support classes
     586 */
     587.no-customize-support .hide-if-no-customize,
     588.customize-support .hide-if-customize {
     589    display: none;
     590}
     591
     592/**
    585593 * Retina display 2x icons
    586594 */
  • trunk/wp-includes/theme.php

    r20908 r20918  
    16371637 */
    16381638function wp_customize_support_script() {
    1639     if ( ! wp_script_is( 'customize-loader', 'queue' ) )
    1640         return;
    1641 
    16421639    $admin_origin = parse_url( admin_url() );
    16431640    $home_origin  = parse_url( home_url() );
Note: See TracChangeset for help on using the changeset viewer.