Changeset 27419 for trunk/src/wp-includes/class-wp-customize-control.php
- Timestamp:
- 03/05/2014 08:40:36 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-control.php
r27398 r27419 815 815 } 816 816 } 817 818 /** 819 * Widget Area Customize Control Class 820 * 821 */ 822 class WP_Widget_Area_Customize_Control extends WP_Customize_Control { 823 public $type = 'sidebar_widgets'; 824 public $sidebar_id; 825 826 public function to_json() { 827 parent::to_json(); 828 $exported_properties = array( 'sidebar_id' ); 829 foreach ( $exported_properties as $key ) { 830 $this->json[ $key ] = $this->$key; 831 } 832 } 833 834 public function render_content() { 835 ?> 836 <span class="button-secondary add-new-widget" tabindex="0"> 837 <?php esc_html_e( 'Add a Widget' ); ?> 838 </span> 839 840 <span class="reorder-toggle" tabindex="0"> 841 <span class="reorder"><?php esc_html_e( 'Reorder' ); ?></span> 842 <span class="reorder-done"><?php esc_html_e( 'Done' ); ?></span> 843 </span> 844 <?php 845 } 846 } 847 848 /** 849 * Widget Form Customize Control Class 850 */ 851 class WP_Widget_Form_Customize_Control extends WP_Customize_Control { 852 public $type = 'widget_form'; 853 public $widget_id; 854 public $widget_id_base; 855 public $sidebar_id; 856 public $is_new = false; 857 public $width; 858 public $height; 859 public $is_wide = false; 860 public $is_live_previewable = false; 861 862 public function to_json() { 863 parent::to_json(); 864 $exported_properties = array( 'widget_id', 'widget_id_base', 'sidebar_id', 'width', 'height', 'is_wide', 'is_live_previewable' ); 865 foreach ( $exported_properties as $key ) { 866 $this->json[ $key ] = $this->$key; 867 } 868 } 869 870 public function render_content() { 871 global $wp_registered_widgets; 872 require_once ABSPATH . '/wp-admin/includes/widgets.php'; 873 874 $widget = $wp_registered_widgets[ $this->widget_id ]; 875 if ( ! isset( $widget['params'][0] ) ) { 876 $widget['params'][0] = array(); 877 } 878 879 $args = array( 880 'widget_id' => $widget['id'], 881 'widget_name' => $widget['name'], 882 ); 883 884 $args = wp_list_widget_controls_dynamic_sidebar( array( 0 => $args, 1 => $widget['params'][0] ) ); 885 echo WP_Customize_Widgets::get_widget_control( $args ); 886 } 887 } 888
Note: See TracChangeset
for help on using the changeset viewer.