/wp-includes/customize/class-wp-customize-sidebar-section.php

  1. <?php 
  2. /** 
  3. * Customize API: WP_Customize_Sidebar_Section class 
  4. * 
  5. * @package WordPress 
  6. * @subpackage Customize 
  7. * @since 4.4.0 
  8. */ 
  9.  
  10. /** 
  11. * Customizer section representing widget area (sidebar). 
  12. * 
  13. * @since 4.1.0 
  14. * 
  15. * @see WP_Customize_Section 
  16. */ 
  17. class WP_Customize_Sidebar_Section extends WP_Customize_Section { 
  18.  
  19. /** 
  20. * Type of this section. 
  21. * 
  22. * @since 4.1.0 
  23. * @access public 
  24. * @var string 
  25. */ 
  26. public $type = 'sidebar'; 
  27.  
  28. /** 
  29. * Unique identifier. 
  30. * 
  31. * @since 4.1.0 
  32. * @access public 
  33. * @var string 
  34. */ 
  35. public $sidebar_id; 
  36.  
  37. /** 
  38. * Gather the parameters passed to client JavaScript via JSON. 
  39. * 
  40. * @since 4.1.0 
  41. * 
  42. * @return array The array to be exported to the client as JSON. 
  43. */ 
  44. public function json() { 
  45. $json = parent::json(); 
  46. $json['sidebarId'] = $this->sidebar_id; 
  47. return $json; 
  48.  
  49. /** 
  50. * Whether the current sidebar is rendered on the page. 
  51. * 
  52. * @since 4.1.0 
  53. * @access public 
  54. * 
  55. * @return bool Whether sidebar is rendered. 
  56. */ 
  57. public function active_callback() { 
  58. return $this->manager->widgets->is_sidebar_rendered( $this->sidebar_id ); 
.