WP_Widget_Area_Customize_Control

Widget Area Customize Control class.

Defined (1)

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

/wp-includes/customize/class-wp-widget-area-customize-control.php  
  1. class WP_Widget_Area_Customize_Control extends WP_Customize_Control { 
  2.  
  3. /** 
  4. * Customize control type. 
  5. * @since 3.9.0 
  6. * @access public 
  7. * @var string 
  8. */ 
  9. public $type = 'sidebar_widgets'; 
  10.  
  11. /** 
  12. * Sidebar ID. 
  13. * @since 3.9.0 
  14. * @access public 
  15. * @var int|string 
  16. */ 
  17. public $sidebar_id; 
  18.  
  19. /** 
  20. * Refreshes the parameters passed to the JavaScript via JSON. 
  21. * @since 3.9.0 
  22. * @access public 
  23. */ 
  24. public function to_json() { 
  25. parent::to_json(); 
  26. $exported_properties = array( 'sidebar_id' ); 
  27. foreach ( $exported_properties as $key ) { 
  28. $this->json[ $key ] = $this->$key; 
  29.  
  30. /** 
  31. * Renders the control's content. 
  32. * @since 3.9.0 
  33. * @access public 
  34. */ 
  35. public function render_content() { 
  36. $id = 'reorder-widgets-desc-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id ); 
  37. ?> 
  38. <button type="button" class="button-secondary add-new-widget" aria-expanded="false" aria-controls="available-widgets"> 
  39. <?php _e( 'Add a Widget' ); ?> 
  40. </button> 
  41. <button type="button" class="button-link reorder-toggle" aria-label="<?php esc_attr_e( 'Reorder widgets' ); ?>" aria-describedby="<?php echo esc_attr( $id ); ?>"> 
  42. <span class="reorder"><?php _ex( 'Reorder', 'Reorder widgets in Customizer' ); ?></span> 
  43. <span class="reorder-done"><?php _ex( 'Done', 'Cancel reordering widgets in Customizer' ); ?></span> 
  44. </button> 
  45. <p class="screen-reader-text" id="<?php echo esc_attr( $id ); ?>"><?php _e( 'When in reorder mode, additional controls to reorder widgets will be available in the widgets list above.' ); ?></p> 
  46. <?php