diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
index ea30b93..4d01520 100644
|
|
final class WP_Customize_Manager { |
1833 | 1833 | * Register some default controls. |
1834 | 1834 | * |
1835 | 1835 | * @since 3.4.0 |
| 1836 | * |
| 1837 | * @global array $_wp_additional_image_sizes |
1836 | 1838 | */ |
1837 | 1839 | public function register_controls() { |
| 1840 | global $_wp_additional_image_sizes; |
1838 | 1841 | |
1839 | 1842 | /* Panel, Section, and Control Types */ |
1840 | 1843 | $this->register_panel_type( 'WP_Customize_Panel' ); |
… |
… |
final class WP_Customize_Manager { |
1962 | 1965 | 'transport' => 'postMessage', |
1963 | 1966 | ) ); |
1964 | 1967 | |
1965 | | $this->add_control( new WP_Customize_Media_Control( $this, 'custom_logo', array( |
| 1968 | $custom_logo_control_args = array( |
1966 | 1969 | 'label' => __( 'Logo' ), |
1967 | 1970 | 'section' => 'title_tagline', |
1968 | 1971 | 'priority' => 8, |
1969 | | 'mime_type' => 'image', |
1970 | 1972 | 'button_labels' => array( |
1971 | 1973 | 'select' => __( 'Select logo' ), |
1972 | 1974 | 'change' => __( 'Change logo' ), |
… |
… |
final class WP_Customize_Manager { |
1976 | 1978 | 'frame_title' => __( 'Select logo' ), |
1977 | 1979 | 'frame_button' => __( 'Choose logo' ), |
1978 | 1980 | ), |
1979 | | ) ) ); |
| 1981 | ); |
| 1982 | $custom_logo_size = get_theme_support( 'custom-logo', 'size' ); |
| 1983 | if ( ! empty( $custom_logo_size ) && has_image_size( $custom_logo_size ) ) { |
| 1984 | $custom_logo_control_args['width'] = $_wp_additional_image_sizes[ $custom_logo_size ]['width']; |
| 1985 | $custom_logo_control_args['height'] = $_wp_additional_image_sizes[ $custom_logo_size ]['height']; |
| 1986 | $custom_logo_control_args['flex_width'] = empty( $_wp_additional_image_sizes[ $custom_logo_size ]['crop'] ); |
| 1987 | $custom_logo_control_args['flex_height'] = empty( $_wp_additional_image_sizes[ $custom_logo_size ]['crop'] ); |
| 1988 | } |
| 1989 | $this->add_control( new WP_Customize_Cropped_Image_Control( $this, 'custom_logo', $custom_logo_control_args ) ); |
1980 | 1990 | |
1981 | 1991 | if ( isset( $this->selective_refresh ) ) { |
1982 | 1992 | $this->selective_refresh->add_partial( 'custom_logo', array( |
diff --git src/wp-includes/js/media-views.js src/wp-includes/js/media-views.js
index 015ec23..7be6868 100644
|
|
CustomizeImageCropper = Controller.Cropper.extend({ |
402 | 402 | var cropDetails = attachment.get( 'cropDetails' ), |
403 | 403 | control = this.get( 'control' ); |
404 | 404 | |
405 | | cropDetails.dst_width = control.params.width; |
406 | | cropDetails.dst_height = control.params.height; |
| 405 | if ( ! control.params.flex_width ) { |
| 406 | cropDetails.dst_width = control.params.width; |
| 407 | } |
| 408 | if ( ! control.params.flex_height ) { |
| 409 | cropDetails.dst_height = control.params.height; |
| 410 | } |
407 | 411 | |
408 | 412 | return wp.ajax.post( 'crop-image', { |
409 | 413 | wp_customize: 'on', |
diff --git src/wp-includes/js/media/controllers/customize-image-cropper.js src/wp-includes/js/media/controllers/customize-image-cropper.js
index dbaa8f8..df2d77b 100644
|
|
CustomizeImageCropper = Controller.Cropper.extend({ |
16 | 16 | var cropDetails = attachment.get( 'cropDetails' ), |
17 | 17 | control = this.get( 'control' ); |
18 | 18 | |
19 | | cropDetails.dst_width = control.params.width; |
20 | | cropDetails.dst_height = control.params.height; |
| 19 | if ( ! control.params.flex_width ) { |
| 20 | cropDetails.dst_width = control.params.width; |
| 21 | } |
| 22 | if ( ! control.params.flex_height ) { |
| 23 | cropDetails.dst_height = control.params.height; |
| 24 | } |
21 | 25 | |
22 | 26 | return wp.ajax.post( 'crop-image', { |
23 | 27 | wp_customize: 'on', |