WP_Customize_Themes_Section

Customize Themes Section class.

Defined (1)

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

/wp-includes/customize/class-wp-customize-themes-section.php  
  1. class WP_Customize_Themes_Section extends WP_Customize_Section { 
  2.  
  3. /** 
  4. * Customize section type. 
  5. * @since 4.2.0 
  6. * @access public 
  7. * @var string 
  8. */ 
  9. public $type = 'themes'; 
  10.  
  11. /** 
  12. * Render the themes section, which behaves like a panel. 
  13. * @since 4.2.0 
  14. * @access protected 
  15. */ 
  16. protected function render() { 
  17. $classes = 'accordion-section control-section control-section-' . $this->type; 
  18. ?> 
  19. <li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>"> 
  20. <h3 class="accordion-section-title"> 
  21. <?php 
  22. if ( $this->manager->is_theme_active() ) { 
  23. echo '<span class="customize-action">' . __( 'Active theme' ) . '</span> ' . $this->title; 
  24. } else { 
  25. echo '<span class="customize-action">' . __( 'Previewing theme' ) . '</span> ' . $this->title; 
  26. ?> 
  27.  
  28. <?php if ( count( $this->controls ) > 0 ) : ?> 
  29. <button type="button" class="button change-theme" tabindex="0"><?php _ex( 'Change', 'theme' ); ?></button> 
  30. <?php endif; ?> 
  31. </h3> 
  32. <div class="customize-themes-panel control-panel-content themes-php"> 
  33. <h3 class="accordion-section-title customize-section-title"> 
  34. <span class="customize-action"><?php _e( 'Customizing' ); ?></span> 
  35. <?php _e( 'Themes' ); ?> 
  36. <span class="title-count theme-count"><?php echo count( $this->controls ) + 1 /** Active theme */; ?></span> 
  37. </h3> 
  38. <h3 class="accordion-section-title customize-section-title"> 
  39. <?php 
  40. if ( $this->manager->is_theme_active() ) { 
  41. echo '<span class="customize-action">' . __( 'Active theme' ) . '</span> ' . $this->title; 
  42. } else { 
  43. echo '<span class="customize-action">' . __( 'Previewing theme' ) . '</span> ' . $this->title; 
  44. ?> 
  45. <button type="button" class="button customize-theme"><?php _e( 'Customize' ); ?></button> 
  46. </h3> 
  47.  
  48. <div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div> 
  49.  
  50. <div id="customize-container"></div> 
  51. <?php if ( count( $this->controls ) > 4 ) : ?> 
  52. <p><label for="themes-filter"> 
  53. <span class="screen-reader-text"><?php _e( 'Search installed themes…' ); ?></span> 
  54. <input type="text" id="themes-filter" placeholder="<?php esc_attr_e( 'Search installed themes…' ); ?>" /> 
  55. </label></p> 
  56. <?php endif; ?> 
  57. <div class="theme-browser rendered"> 
  58. <ul class="themes accordion-section-content"> 
  59. </ul> 
  60. </div> 
  61. </div> 
  62. </li> 
  63. <?php }