WP_Customize_Cropped_Image_Control

Customize Cropped Image Control class.

Defined (1)

The class is defined in the following location(s).

/wp-includes/customize/class-wp-customize-cropped-image-control.php  
  1. class WP_Customize_Cropped_Image_Control extends WP_Customize_Image_Control { 
  2.  
  3. /** 
  4. * Control type. 
  5. * @since 4.3.0 
  6. * @access public 
  7. * @var string 
  8. */ 
  9. public $type = 'cropped_image'; 
  10.  
  11. /** 
  12. * Suggested width for cropped image. 
  13. * @since 4.3.0 
  14. * @access public 
  15. * @var int 
  16. */ 
  17. public $width = 150; 
  18.  
  19. /** 
  20. * Suggested height for cropped image. 
  21. * @since 4.3.0 
  22. * @access public 
  23. * @var int 
  24. */ 
  25. public $height = 150; 
  26.  
  27. /** 
  28. * Whether the width is flexible. 
  29. * @since 4.3.0 
  30. * @access public 
  31. * @var bool 
  32. */ 
  33. public $flex_width = false; 
  34.  
  35. /** 
  36. * Whether the height is flexible. 
  37. * @since 4.3.0 
  38. * @access public 
  39. * @var bool 
  40. */ 
  41. public $flex_height = false; 
  42.  
  43. /** 
  44. * Enqueue control related scripts/styles. 
  45. * @since 4.3.0 
  46. * @access public 
  47. */ 
  48. public function enqueue() { 
  49. wp_enqueue_script( 'customize-views' ); 
  50.  
  51. parent::enqueue(); 
  52.  
  53. /** 
  54. * Refresh the parameters passed to the JavaScript via JSON. 
  55. * @since 4.3.0 
  56. * @access public 
  57. * @see WP_Customize_Control::to_json() 
  58. */ 
  59. public function to_json() { 
  60. parent::to_json(); 
  61.  
  62. $this->json['width'] = absint( $this->width ); 
  63. $this->json['height'] = absint( $this->height ); 
  64. $this->json['flex_width'] = absint( $this->flex_width ); 
  65. $this->json['flex_height'] = absint( $this->flex_height ); 
  66.