Pristine upstream, unpacked from the official wordpress.org tarball. https://wordpress.org/wordpress-7.1.1.tar.gz sha1 2a9d68474e8703aa3a66f80427b325e0941b6a1e (published by wordpress.org) sha256 3996fee13448ef12e07e9f0c77db2f655ffa1b7cde71c80a4965d3bf1fb956b3 This branch carries nothing but upstream releases, one commit each, and is never edited. It is the other side of the git-subtree merge that brings security releases into SiriusPress/wordpress/ — see SiriusPress/docs/upstream-merges.md.
85 lines
1.4 KiB
PHP
85 lines
1.4 KiB
PHP
<?php
|
|
/**
|
|
* Customize API: WP_Customize_Cropped_Image_Control class
|
|
*
|
|
* @package WordPress
|
|
* @subpackage Customize
|
|
* @since 4.4.0
|
|
*/
|
|
|
|
/**
|
|
* Customize Cropped Image Control class.
|
|
*
|
|
* @since 4.3.0
|
|
*
|
|
* @see WP_Customize_Image_Control
|
|
*/
|
|
class WP_Customize_Cropped_Image_Control extends WP_Customize_Image_Control {
|
|
|
|
/**
|
|
* Control type.
|
|
*
|
|
* @since 4.3.0
|
|
* @var string
|
|
*/
|
|
public $type = 'cropped_image';
|
|
|
|
/**
|
|
* Suggested width for cropped image.
|
|
*
|
|
* @since 4.3.0
|
|
* @var int
|
|
*/
|
|
public $width = 150;
|
|
|
|
/**
|
|
* Suggested height for cropped image.
|
|
*
|
|
* @since 4.3.0
|
|
* @var int
|
|
*/
|
|
public $height = 150;
|
|
|
|
/**
|
|
* Whether the width is flexible.
|
|
*
|
|
* @since 4.3.0
|
|
* @var bool
|
|
*/
|
|
public $flex_width = false;
|
|
|
|
/**
|
|
* Whether the height is flexible.
|
|
*
|
|
* @since 4.3.0
|
|
* @var bool
|
|
*/
|
|
public $flex_height = false;
|
|
|
|
/**
|
|
* Enqueue control related scripts/styles.
|
|
*
|
|
* @since 4.3.0
|
|
*/
|
|
public function enqueue() {
|
|
wp_enqueue_script( 'customize-views' );
|
|
|
|
parent::enqueue();
|
|
}
|
|
|
|
/**
|
|
* Refresh the parameters passed to the JavaScript via JSON.
|
|
*
|
|
* @since 4.3.0
|
|
*
|
|
* @see WP_Customize_Control::to_json()
|
|
*/
|
|
public function to_json() {
|
|
parent::to_json();
|
|
|
|
$this->json['width'] = absint( $this->width );
|
|
$this->json['height'] = absint( $this->height );
|
|
$this->json['flex_width'] = absint( $this->flex_width );
|
|
$this->json['flex_height'] = absint( $this->flex_height );
|
|
}
|
|
}
|