Redux_Customizer_Section

Customizer section representing widget area (sidebar).

Defined (1)

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

/library/admin/redux-framework/inc/extensions/customizer/inc/customizer_section.php  
  1. class Redux_Customizer_Section extends WP_Customize_Section { 
  2.  
  3. /** 
  4. * Type of this section. 
  5. * @since 4.1.0 
  6. * @access public 
  7. * @var string 
  8. */ 
  9. public $type = 'redux'; 
  10.  
  11. /** 
  12. * Constructor. 
  13. * Any supplied $args override class property defaults. 
  14. * @since 3.4.0 
  15. * @param WP_Customize_Manager $manager Customizer bootstrap instance. 
  16. * @param string $id An specific ID of the section. 
  17. * @param array $args Section arguments. 
  18. */ 
  19. public function __construct( $manager, $id, $args = array() ) { 
  20. $keys = array_keys( get_object_vars( $this ) ); 
  21. foreach ( $keys as $key ) { 
  22. if ( isset( $args[ $key ] ) ) { 
  23. $this->$key = $args[ $key ]; 
  24.  
  25. $this->manager = $manager; 
  26. $this->id = $id; 
  27. if ( empty( $this->active_callback ) ) { 
  28. $this->active_callback = array( $this, 'active_callback' ); 
  29. self::$instance_count += 1; 
  30. $this->instance_number = self::$instance_count; 
  31.  
  32. $this->controls = array(); // Users cannot customize the $controls array. 
  33.  
  34. // TODO Redux addition 
  35. if ( isset( $args['section'] ) ) { 
  36. $this->section = $args['section']; 
  37. $this->description = isset( $this->section['desc'] ) ? $this->section['desc'] : ''; 
  38. $this->opt_name = isset( $args['opt_name'] ) ? $args['opt_name'] : ''; 
  39.  
  40. /** 
  41. * An Underscore (JS) template for rendering this section. 
  42. * Class variables for this section class are available in the `data` JS object; 
  43. * export custom variables by overriding {@see WP_Customize_Section::json()}. 
  44. * @see WP_Customize_Section::print_template() 
  45. * @since 4.3.0 
  46. */ 
  47. protected function render_template() { 
  48. ?> 
  49. <li id="accordion-section-{{ data.id }}" class="redux-section accordion-section control-section control-section-{{ data.type }}"> 
  50. <h3 class="accordion-section-title" tabindex="0"> 
  51. {{ data.title }} 
  52. <span class="screen-reader-text"><?php _e( 'Press return or enter to open', 'evolve' ); ?></span> 
  53. </h3> 
  54. <ul class="accordion-section-content redux-main"> 
  55.  
  56. <li class="customize-section-description-container"> 
  57. <div class="customize-section-title"> 
  58. <button class="customize-section-back" tabindex="-1"> 
  59. <span class="screen-reader-text"><?php _e( 'Back', 'evolve' ); ?></span> 
  60. </button> 
  61. <h3> 
  62. <span class="customize-action"> 
  63. {{{ data.customizeAction }}} 
  64. </span> {{ data.title }} 
  65. </h3> 
  66. </div> 
  67. <# if ( data.description ) { #> 
  68. <p class="description customize-section-description">{{{ data.description }}}</p> 
  69. <# } #> 
  70. <?php 
  71. if ( isset( $this->opt_name ) && isset( $this->section ) ) { 
  72. do_action( "redux/page/{$this->opt_name}/section/before", $this->section ); 
  73. ?> 
  74. </li> 
  75. </ul> 
  76. </li> 
  77. <?php 
  78.  
  79. /** 
  80. * Render the section, and the controls that have been added to it. 
  81. * @since 3.4.0 
  82. */ 
  83. protected function render_fallback() { 
  84. $classes = 'accordion-section redux-section control-section control-section-' . $this->type; 
  85. ?> 
  86. <li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>"> 
  87. <h3 class="accordion-section-title" tabindex="0"> 
  88. <?php 
  89. echo wp_kses( $this->title, array( 
  90. 'em' => array(),  
  91. 'i' => array(),  
  92. 'strong' => array(),  
  93. 'span' => array( 
  94. 'class' => array(),  
  95. 'style' => array(),  
  96. ),  
  97. ) ); 
  98. ?> 
  99. <span class="screen-reader-text"><?php esc_attr_e( 'Press return or enter to expand', 'evolve' ); ?></span> 
  100. </h3> 
  101. <ul class="accordion-section-content redux-main"> 
  102. <?php 
  103. if ( isset( $this->opt_name ) && isset( $this->section ) ) { 
  104. do_action( "redux/page/{$this->opt_name}/section/before", $this->section ); 
  105. ?> 
  106. <?php if ( ! empty( $this->description ) ) : ?> 
  107. <li class="customize-section-description-container"> 
  108. <p class="description customize-section-description legacy"><?php echo $this->description; ?></p> 
  109. </li> 
  110. <?php endif; ?> 
  111. </ul> 
  112. </li> 
  113. <?php 
  114.  
  115. protected function render() { 
  116. global $wp_version; 
  117. $version = explode( '-', $wp_version ); 
  118. if ( version_compare( $version[0], '4.3', '<' ) ) { 
  119. $this->render_fallback(); 
  120.