Ticket #35941: 35941.2.diff
File 35941.2.diff, 10.2 KB (added by , 9 years ago) |
---|
-
src/wp-admin/css/customize-controls.css
diff --git src/wp-admin/css/customize-controls.css src/wp-admin/css/customize-controls.css index 82132e3..c3b6e01 100644
p.customize-section-description { 721 721 .customize-control-background .current, 722 722 .customize-control-cropped_image .current, 723 723 .customize-control-site_icon .current, 724 .customize-control-custom_logo .current,725 724 .customize-control-header .current { 726 725 margin-bottom: 8px; 727 726 } … … p.customize-section-description { 763 762 .customize-control-site_icon .remove-button, 764 763 .customize-control-site_icon .default-button, 765 764 .customize-control-site_icon .upload-button, 766 .customize-control-custom_logo .remove-button,767 .customize-control-custom_logo .default-button,768 .customize-control-custom_logo .upload-button,769 765 .customize-control-header button.new, 770 766 .customize-control-header button.remove { 771 767 white-space: normal; … … p.customize-section-description { 779 775 .customize-control-background .current .container, 780 776 .customize-control-cropped_image .current .container, 781 777 .customize-control-site_icon .current .container, 782 .customize-control-custom_logo .current .container,783 778 .customize-control-header .current .container { 784 779 overflow: hidden; 785 780 -webkit-border-radius: 2px; … … p.customize-section-description { 793 788 .customize-control-background .current .container, 794 789 .customize-control-cropped_image .current .container, 795 790 .customize-control-site_icon .current .container, 796 .customize-control-custom_logo .current .container,797 791 .customize-control-image .current .container { 798 792 min-height: 40px; 799 793 } … … p.customize-section-description { 822 816 .customize-control-background .inner, 823 817 .customize-control-cropped_image .inner, 824 818 .customize-control-site_icon .inner, 825 .customize-control-custom_logo .inner,826 819 .customize-control-header .inner { 827 820 display: none; 828 821 position: absolute; … … p.customize-section-description { 838 831 .customize-control-background .inner, 839 832 .customize-control-cropped_image .inner, 840 833 .customize-control-site_icon .inner, 841 .customize-control-custom_logo .inner,842 834 .customize-control-image .inner { 843 835 display: block; 844 836 min-height: 40px; … … p.customize-section-description { 850 842 .customize-control-background .inner, 851 843 .customize-control-cropped_image .inner, 852 844 .customize-control-site_icon .inner, 853 .customize-control-custom_logo.inner,854 845 .customize-control-header .inner, 855 846 .customize-control-header .inner .dashicons { 856 847 line-height: 20px; … … p.customize-section-description { 950 941 100% { color: #d4b146; } 951 942 } 952 943 953 .customize-control-media .actions,954 .customize-control-upload .actions,955 .customize-control-image .actions,956 .customize-control-background .actions,957 .customize-control-cropped_image .actions,958 .customize-control-site_icon .actions,959 .customize-control-header .actions {960 margin-bottom: 32px;961 }962 963 944 .customize-control-header .choice { 964 945 position: relative; 965 946 display: block; … … p.customize-section-description { 994 975 .customize-control-cropped_image .default-button, 995 976 .customize-control-site_icon .remove-button, 996 977 .customize-control-site_icon .default-button, 997 .customize-control-custom_logo .remove-button,998 .customize-control-custom_logo .default-button,999 978 .customize-control-header .remove { 1000 979 float: left; 1001 980 margin-right: 3px; … … p.customize-section-description { 1007 986 .customize-control-background .upload-button, 1008 987 .customize-control-cropped_image .upload-button, 1009 988 .customize-control-site_icon .upload-button, 1010 .customize-control-custom_logo .upload-button,1011 989 .customize-control-header .new { 1012 990 float: right; 1013 991 } -
src/wp-admin/js/customize-controls.js
diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js index 8fcf08b..f514cf7 100644
1790 1790 control.pausePlayer(); 1791 1791 }); 1792 1792 1793 // Re-render whenever the control's setting changes. 1794 control.setting.bind( function () { control.renderContent(); } ); 1793 control.setting.bind( function( value ) { 1794 1795 // Send attachment information to the preview for possible use in `postMessage` transport. 1796 wp.media.attachment( value ).fetch().done( function() { 1797 wp.customize.previewer.send( control.setting.id + '-attachment-data', this.attributes ); 1798 } ); 1799 1800 // Re-render whenever the control's setting changes. 1801 control.renderContent(); 1802 } ); 1795 1803 }, 1796 1804 1797 1805 pausePlayer: function () { … … 2303 2311 }); 2304 2312 2305 2313 /** 2306 * A control for selecting custom logos.2307 *2308 * @class2309 * @augments wp.customize.MediaControl2310 * @augments wp.customize.Control2311 * @augments wp.customize.Class2312 */2313 api.CustomLogoControl = api.MediaControl.extend({2314 2315 /**2316 * When the control's DOM structure is ready,2317 * set up internal event bindings.2318 */2319 ready: function() {2320 var control = this;2321 2322 // Shortcut so that we don't have to use _.bind every time we add a callback.2323 _.bindAll( control, 'restoreDefault', 'removeFile', 'openFrame', 'select' );2324 2325 // Bind events, with delegation to facilitate re-rendering.2326 control.container.on( 'click keydown', '.upload-button', control.openFrame );2327 control.container.on( 'click keydown', '.thumbnail-image img', control.openFrame );2328 control.container.on( 'click keydown', '.default-button', control.restoreDefault );2329 control.container.on( 'click keydown', '.remove-button', control.removeFile );2330 2331 control.setting.bind( function( attachmentId ) {2332 wp.media.attachment( attachmentId ).fetch().done( function() {2333 wp.customize.previewer.send( 'custom-logo-attachment-data', this.attributes );2334 } );2335 2336 // Re-render whenever the control's setting changes.2337 control.renderContent();2338 } );2339 }2340 });2341 2342 /**2343 2314 * @class 2344 2315 * @augments wp.customize.Control 2345 2316 * @augments wp.customize.Class … … 3245 3216 image: api.ImageControl, 3246 3217 cropped_image: api.CroppedImageControl, 3247 3218 site_icon: api.SiteIconControl, 3248 custom_logo: api.CustomLogoControl,3249 3219 header: api.HeaderControl, 3250 3220 background: api.BackgroundControl, 3251 3221 theme: api.ThemeControl -
src/wp-includes/class-wp-customize-manager.php
diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php index ff204d9..3699b21 100644
final class WP_Customize_Manager { 217 217 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-control.php' ); 218 218 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php' ); 219 219 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php' ); 220 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-custom-logo-control.php' );221 220 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php' ); 222 221 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php' ); 223 222 require_once( ABSPATH . WPINC . '/customize/class-wp-widget-area-customize-control.php' ); … … final class WP_Customize_Manager { 1848 1847 $this->register_control_type( 'WP_Customize_Background_Image_Control' ); 1849 1848 $this->register_control_type( 'WP_Customize_Cropped_Image_Control' ); 1850 1849 $this->register_control_type( 'WP_Customize_Site_Icon_Control' ); 1851 $this->register_control_type( 'WP_Customize_Custom_Logo_Control' );1852 1850 $this->register_control_type( 'WP_Customize_Theme_Control' ); 1853 1851 1854 1852 /* Themes */ … … final class WP_Customize_Manager { 1965 1963 'transport' => 'postMessage', 1966 1964 ) ); 1967 1965 1968 $this->add_control( new WP_Customize_ Custom_Logo_Control( $this, 'custom_logo', array(1966 $this->add_control( new WP_Customize_Media_Control( $this, 'custom_logo', array( 1969 1967 'label' => __( 'Logo' ), 1970 1968 'section' => 'title_tagline', 1971 1969 'priority' => 0, 1970 'mime_type' => 'image', 1971 'button_labels' => array( 1972 'select' => __( 'Select logo' ), 1973 'change' => __( 'Change logo' ), 1974 'remove' => __( 'Remove' ), 1975 'default' => __( 'Default' ), 1976 'placeholder' => __( 'No logo selected' ), 1977 'frame_title' => __( 'Select logo' ), 1978 'frame_button' => __( 'Choose logo' ), 1979 ), 1972 1980 ) ) ); 1973 1981 1974 1982 if ( isset( $this->selective_refresh ) ) { -
deleted file src/wp-includes/customize/class-wp-customize-custom-logo-control.php
diff --git src/wp-includes/customize/class-wp-customize-custom-logo-control.php src/wp-includes/customize/class-wp-customize-custom-logo-control.php deleted file mode 100644 index 9daff2d..0000000
+ - 1 <?php2 /**3 * Customize API: WP_Customize_Custom_Logo_Control class4 *5 * @package WordPress6 * @subpackage Customize7 * @since 4.5.08 */9 10 /**11 * Customize custom logo control class.12 *13 * Used only for custom functionality in JavaScript.14 *15 * @since 4.5.016 *17 * @see WP_Customize_Image_Control18 */19 class WP_Customize_Custom_Logo_Control extends WP_Customize_Image_Control {20 21 /**22 * Control type.23 *24 * @since 4.5.025 * @access public26 * @var string27 */28 public $type = 'custom_logo';29 30 /**31 * Constructor.32 *33 * @since 4.5.034 * @access public35 *36 * @param WP_Customize_Manager $manager Customizer bootstrap instance.37 * @param string $id Control ID.38 * @param array $args Optional. Arguments to override class property defaults.39 */40 public function __construct( $manager, $id, $args = array() ) {41 parent::__construct( $manager, $id, $args );42 43 $this->button_labels = array(44 'select' => __( 'Select logo' ),45 'change' => __( 'Change logo' ),46 'remove' => __( 'Remove' ),47 'default' => __( 'Default' ),48 'placeholder' => __( 'No logo selected' ),49 'frame_title' => __( 'Select logo' ),50 'frame_button' => __( 'Choose logo' ),51 );52 }53 } -
src/wp-includes/js/customize-preview.js
diff --git src/wp-includes/js/customize-preview.js src/wp-includes/js/customize-preview.js index 96a7b28..8d1d759 100644
234 234 * 235 235 * @since 4.5.0 236 236 */ 237 api.preview.bind( 'custom -logo-attachment-data', function( attachment ) {237 api.preview.bind( 'custom_logo-attachment-data', function( attachment ) { 238 238 var $logo = $( '.custom-logo' ), 239 239 size = $logo.data( 'size' ), 240 240 srcset = [];