Evolve_Redux_Customizer_Section

Customizer section representing Evolve section for Redux.

Defined (1)

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

/library/admin/evolve-exts/class-evolve-redux-customizer-section.php  
  1. class Evolve_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. // TODO Redux addition 
  34. if (isset($args['section'])) { 
  35. $this->section = $args['section']; 
  36. $this->description = isset($this->section['desc']) ? $this->section['desc'] : ''; 
  37. $this->opt_name = isset($args['opt_name']) ? $args['opt_name'] : ''; 
  38. $this->class_name = isset($this->section['class']) ? $this->section['class'] : ''; 
  39.  
  40.  
  41. /** 
  42. * An Underscore (JS) template for rendering this section. 
  43. * Class variables for this section class are available in the `data` JS object; 
  44. * export custom variables by overriding {@see WP_Customize_Section::json()}. 
  45. * @see WP_Customize_Section::print_template() 
  46. * @since 4.3.0 
  47. */ 
  48. protected function render_template() { 
  49. ?> 
  50. <li id="accordion-section-{{ data.id }}" class="redux-section accordion-section control-section control-section-{{ data.type }}"> 
  51. <h3 class="accordion-section-title" tabindex="0"> 
  52. {{ data.title }} 
  53. <span class="screen-reader-text"><?php _e('Press return or enter to open', 'evolve'); ?></span> 
  54. </h3> 
  55. <ul class="accordion-section-content redux-main"> 
  56.  
  57. <li class="customize-section-description-container"> 
  58. <div class="customize-section-title"> 
  59. <button class="customize-section-back" tabindex="-1"> 
  60. <span class="screen-reader-text"><?php _e('Back', 'evolve'); ?></span> 
  61. </button> 
  62. <h3> 
  63. <span class="customize-action"> 
  64. {{{ data.customizeAction }}} 
  65. </span> {{ data.title }} 
  66. </h3> 
  67. </div> 
  68. <# if ( data.description ) { #> 
  69. <p class="description customize-section-description">{{{ data.description }}}</p> 
  70. <# } #> 
  71. <?php 
  72. if (isset($this->opt_name) && isset($this->section)) { 
  73. do_action("redux/page/{$this->opt_name}/section/before", $this->section); 
  74. ?> 
  75. </li> 
  76. </ul> 
  77. </li> 
  78. <?php 
  79.  
  80. /** 
  81. * Render the section, and the controls that have been added to it. 
  82. * @since 3.4.0 
  83. */ 
  84. protected function render_fallback() { 
  85. $classes = 'accordion-section redux-section control-section control-section-' . $this->type; 
  86. ?> 
  87. <li id="accordion-section-<?php echo esc_attr($this->id); ?>" class="<?php echo $this->class_name.' '.esc_attr($classes); ?>"> 
  88. <h3 class="accordion-section-title" tabindex="0"> 
  89. <?php 
  90. echo wp_kses($this->title, array( 
  91. 'em' => array(),  
  92. 'i' => array(),  
  93. 'strong' => array(),  
  94. 'span' => array( 
  95. 'class' => array(),  
  96. 'style' => array(),  
  97. ),  
  98. )); 
  99. ?> 
  100. <span class="screen-reader-text"><?php _e('Press return or enter to open', 'evolve'); ?></span> 
  101. </h3> 
  102. <ul class="accordion-section-content redux-main"> 
  103. <li class="customize-section-description-container"> 
  104. <div class="customize-section-title"> 
  105. <button class="customize-section-back" tabindex="-1"> 
  106. <span class="screen-reader-text"><?php _e('Back', 'evolve'); ?></span> 
  107. </button> 
  108. <h3> 
  109. <span class="customize-action"><?php _e('Customizing', 'evolve'); ?></span> 
  110. <?php echo $this->title; ?> 
  111. </h3> 
  112. </div> 
  113. <?php if (!empty($this->description)) : ?> 
  114. <p class="description customize-section-description legacy"><?php echo $this->description; ?></p> 
  115. <?php endif; ?> 
  116. </li> 
  117. <?php 
  118. if (isset($this->opt_name) && isset($this->section)) { 
  119. do_action("redux/page/{$this->opt_name}/section/before", $this->section); 
  120. ?> 
  121. </ul> 
  122. </li> 
  123. <?php 
  124.  
  125. protected function render() { 
  126. $this->render_fallback(); // force to old fashion call :|, double check on future verion 
  127. // global $wp_version; 
  128. // $version = explode( '-', $wp_version ); 
  129. // if ( version_compare( $version[0], '4.3', '<' ) ) { 
  130. // $this->render_fallback(); 
  131. // } 
  132.