Redux_Customizer_Panel

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_panel.php  
  1. class Redux_Customizer_Panel extends WP_Customize_Panel { 
  2.  
  3. /** 
  4. * Type of this panel. 
  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 4.0.0 
  15. * @param WP_Customize_Manager $manager Customizer bootstrap instance. 
  16. * @param string $id An specific ID for the panel. 
  17. * @param array $args Panel 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. $this->manager = $manager; 
  25. $this->id = $id; 
  26. if ( empty( $this->active_callback ) ) { 
  27. $this->active_callback = array( $this, 'active_callback' ); 
  28. self::$instance_count += 1; 
  29. $this->instance_number = self::$instance_count; 
  30.  
  31. $this->sections = array(); // Users cannot customize the $sections array. 
  32.  
  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. // TODO END Redux Addition 
  39.  
  40. /** 
  41. * WP < 4.3 Render 
  42. * @since 
  43. * @access protected 
  44. */ 
  45. protected function render() { 
  46. global $wp_version; 
  47. $version = explode( '-', $wp_version ); 
  48. if ( version_compare( $version[0], '4.3', '<' ) ) { 
  49. $this->render_fallback(); 
  50.  
  51.  
  52. protected function render_fallback() { 
  53. $classes = 'accordion-section redux-main redux-panel control-section control-panel control-panel-' . esc_attr($this->type); 
  54. ?> 
  55. <li id="accordion-panel-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>"> 
  56. <h3 class="accordion-section-title" tabindex="0"> 
  57. <?php 
  58. echo wp_kses( $this->title, array( 
  59. 'em' => array(),  
  60. 'i' => array(),  
  61. 'strong' => array(),  
  62. 'span' => array( 
  63. 'class' => array(),  
  64. 'style' => array(),  
  65. ),  
  66. ) ); 
  67. ?> 
  68. <span class="screen-reader-text"><?php esc_html_e( 'Press return or enter to open this panel', 'evolve' ); ?></span> 
  69. </h3> 
  70. <ul class="accordion-sub-container control-panel-content"> 
  71. <table class="form-table"> 
  72. <tbody><?php $this->render_content(); ?></tbody> 
  73. </table> 
  74. </ul> 
  75. </li> 
  76. <?php 
  77.  
  78. /** 
  79. * Render the sections that have been added to the panel. 
  80. * @since 4.1.0 
  81. * @access protected 
  82. */ 
  83. protected function render_content() { 
  84. ?> 
  85. <li class="panel-meta accordion-section redux-panel redux-panel-meta control-section<?php if ( empty( $this->description ) ) { 
  86. echo ' cannot-expand'; 
  87. } ?>"> 
  88. <div class="accordion-section-title" tabindex="0"> 
  89. <span class="preview-notice"><?php 
  90. /** translators: %s is the site/panel title in the Customizer */ 
  91. echo sprintf( __( 'You are customizing %s', 'evolve' ), '<strong class="panel-title">' . esc_html( $this->title ) . '</strong>' ); 
  92. ?></span> 
  93. </div> 
  94. <?php if ( ! empty( $this->description ) ) : ?> 
  95. <div class="accordion-section-content description legacy"> 
  96. <?php echo $this->description; ?> 
  97. </div> 
  98. <?php endif; ?> 
  99. </li> 
  100. <?php 
  101.  
  102. /** 
  103. * An Underscore (JS) template for this panel's content (but not its container). 
  104. * Class variables for this panel class are available in the `data` JS object; 
  105. * export custom variables by overriding {@see WP_Customize_Panel::json()}. 
  106. * @see WP_Customize_Panel::print_template() 
  107. * @since 4.3.0 
  108. */ 
  109. protected function content_template() { 
  110. ?> 
  111. <li class="panel-meta customize-info redux-panel accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>"> 
  112. <button class="customize-panel-back" tabindex="-1"> 
  113. <span class="screen-reader-text"><?php esc_attr_e( 'Back', 'evolve' ); ?></span></button> 
  114. <div class="accordion-section-title"> 
  115. <span class="preview-notice"><?php 
  116. /** translators: %s is the site/panel title in the Customizer */ 
  117. echo sprintf( __( 'You are customizing %s', 'evolve' ), '<strong class="panel-title">{{ data.title }}</strong>' ); 
  118. ?></span> 
  119. <# if ( data.description ) { #> 
  120. <button class="customize-help-toggle dashicons dashicons-editor-help" tabindex="0" aria-expanded="false"> 
  121. <span class="screen-reader-text"><?php esc_attr_e( 'Help', 'evolve' ); ?></span></button> 
  122. <# } #> 
  123. </div> 
  124. <# if ( data.description ) { #> 
  125. <div class="description customize-panel-description"> 
  126. {{{ data.description }}} 
  127. </div> 
  128. <# } #> 
  129. </li> 
  130. <?php