Changeset 33154 for trunk/src/wp-includes/class-wp-customize-control.php
- Timestamp:
- 07/10/2015 09:32:23 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-control.php
r33090 r33154 1002 1002 1003 1003 /** 1004 * Customize Cropped Image Control class. 1005 * 1006 * @since 4.3.0 1007 * 1008 * @see WP_Customize_Image_Control 1009 */ 1010 class WP_Customize_Cropped_Image_Control extends WP_Customize_Image_Control { 1011 1012 /** 1013 * Control type. 1014 * 1015 * @since 4.3.0 1016 * 1017 * @access public 1018 * @var string 1019 */ 1020 public $type = 'cropped_image'; 1021 1022 /** 1023 * Suggested width for cropped image. 1024 * 1025 * @since 4.3.0 1026 * 1027 * @access public 1028 * @var int 1029 */ 1030 public $width = 150; 1031 1032 /** 1033 * Suggested height for cropped image. 1034 * 1035 * @since 4.3.0 1036 * 1037 * @access public 1038 * @var int 1039 */ 1040 public $height = 150; 1041 1042 /** 1043 * Whether the width is flexible. 1044 * 1045 * @since 4.3.0 1046 * 1047 * @access public 1048 * @var bool 1049 */ 1050 public $flex_width = false; 1051 1052 /** 1053 * Whether the height is flexible. 1054 * 1055 * @since 4.3.0 1056 * 1057 * @access public 1058 * @var bool 1059 */ 1060 public $flex_height = false; 1061 1062 /** 1063 * Enqueue control related scripts/styles. 1064 * 1065 * @since 4.3.0 1066 * 1067 * @access public 1068 */ 1069 public function enqueue() { 1070 wp_enqueue_script( 'customize-views' ); 1071 1072 parent::enqueue(); 1073 } 1074 1075 /** 1076 * Refresh the parameters passed to the JavaScript via JSON. 1077 * 1078 * @since 4.3.0 1079 * 1080 * @access public 1081 * @uses WP_Customize_Image_Control::to_json() 1082 * @see WP_Customize_Control::to_json() 1083 */ 1084 public function to_json() { 1085 parent::to_json(); 1086 1087 $this->json['width'] = absint( $this->width ); 1088 $this->json['height'] = absint( $this->height ); 1089 $this->json['flex_width'] = absint( $this->flex_width ); 1090 $this->json['flex_height'] = absint( $this->flex_height ); 1091 } 1092 1093 } 1094 1095 /** 1096 * Customize Site Icon control class. 1097 * 1098 * Used only for custom functionality in JavaScript. 1099 * 1100 * @since 4.3.0 1101 * 1102 * @see WP_Customize_Cropped_Image_Control 1103 */ 1104 class WP_Customize_Site_Icon_Control extends WP_Customize_Cropped_Image_Control { 1105 1106 /** 1107 * Control type. 1108 * 1109 * @since 4.3.0 1110 * 1111 * @access public 1112 * @var string 1113 */ 1114 public $type = 'site_icon'; 1115 1116 /** 1117 * Constructor. 1118 * 1119 * @since 4.3.0 1120 * 1121 * @param WP_Customize_Manager $manager 1122 * @param string $id 1123 * @param array $args 1124 */ 1125 public function __construct( $manager, $id, $args = array() ) { 1126 parent::__construct( $manager, $id, $args ); 1127 add_action( 'customize_controls_print_styles', 'wp_site_icon', 99 ); 1128 } 1129 } 1130 1131 /** 1004 1132 * Customize Header Image Control class. 1005 1133 *
Note: See TracChangeset
for help on using the changeset viewer.