Changeset 20645 for trunk/wp-includes/class-wp-customize.php
- Timestamp:
- 04/30/2012 03:46:17 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-customize.php
r20598 r20645 18 18 protected $controls = array(); 19 19 20 protected $customized; 21 22 private $_post_values; 23 20 24 /** 21 25 * Constructor. … … 31 35 add_action( 'admin_init', array( $this, 'admin_init' ) ); 32 36 add_action( 'wp_loaded', array( $this, 'wp_loaded' ) ); 37 38 add_action( 'wp_ajax_customize_save', array( $this, 'save' ) ); 33 39 34 40 add_action( 'customize_register', array( $this, 'register_controls' ) ); … … 150 156 151 157 /** 158 * Decode the $_POST attribute used to override the WP_Customize_Setting values. 159 * 160 * @since 3.4.0 161 */ 162 public function post_value( $setting ) { 163 if ( ! isset( $this->_post_values ) ) { 164 if ( isset( $_POST['customized'] ) ) 165 $this->_post_values = json_decode( stripslashes( $_POST['customized'] ), true ); 166 else 167 $this->_post_values = false; 168 } 169 170 if ( isset( $this->_post_values[ $setting->id ] ) ) 171 return $setting->sanitize( $this->_post_values[ $setting->id ] ); 172 } 173 174 175 /** 152 176 * Print javascript settings. 153 177 * … … 268 292 */ 269 293 public function admin_init() { 270 if ( isset( $_REQUEST['save_customize_controls'] ) )271 $this->save();272 273 294 if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) 274 295 return; … … 298 319 public function save() { 299 320 if ( ! $this->is_preview() ) 300 return;301 302 check_a dmin_referer( 'customize_controls' );321 die; 322 323 check_ajax_referer( 'customize_controls', 'nonce' ); 303 324 304 325 // Do we have to switch themes? 305 326 if ( $this->get_stylesheet() != $this->original_stylesheet ) { 306 327 if ( ! current_user_can( 'switch_themes' ) ) 307 return;328 die; 308 329 309 330 // Temporarily stop previewing the theme to allow switch_themes() … … 321 342 322 343 add_action( 'admin_notices', array( $this, '_save_feedback' ) ); 344 345 die; 323 346 } 324 347
Note: See TracChangeset
for help on using the changeset viewer.