Make WordPress Core


Ignore:
Timestamp:
03/29/2012 06:35:54 AM (13 years ago)
Author:
koopersmith
Message:

Theme Customizer: Move upload and image controls to subclasses. see #19910.

Instead of grouping together every control parameter into a single array and passing them all to the JS, use subclasses with custom parameters to implement additional PHP functionality and the parameter to send only the necessary variables to the JavaScript control.

Replaces WP_Customize_Control->control_params with WP_Customize_Control->json and WP_Customize_Control->to_json(). The to_json() method refreshes the json array passed to the JavaScript control (set to control.param by default).

Creates WP_Customize_Upload_Control and WP_Customize_Image_Control.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ajax-actions.php

    r20279 r20319  
    16161616    }
    16171617
    1618     $post_data = is_array( $_REQUEST['post_data'] ) ? $_REQUEST['post_data'] : array();
     1618    $post_data = isset( $_REQUEST['post_data'] ) ? $_REQUEST['post_data'] : array();
    16191619
    16201620    $attachment_id = media_handle_upload( 'async-upload', $post_id, $post_data );
Note: See TracChangeset for help on using the changeset viewer.