Changeset 28861 for trunk/src/wp-includes/class-wp-customize-section.php
- Timestamp:
- 06/26/2014 08:16:21 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src
- Property svn:ignore
-
old new 1 1 .wp-tests-version 2 2 .htaccess 3 web-store-experiences
-
- Property svn:ignore
-
trunk/src/wp-includes/class-wp-customize-section.php
r28827 r28861 37 37 */ 38 38 public $priority = 10; 39 40 /** 41 * Panel in which to show the section, making it a sub-section. 42 * 43 * @since 4.0.0 44 * @access public 45 * @var string 46 */ 47 public $panel = ''; 39 48 40 49 /** … … 163 172 */ 164 173 protected function render() { 174 $classes = 'control-section accordion-section'; 175 if ( $this->panel ) { 176 $classes .= ' control-subsection'; 177 } 165 178 ?> 166 <li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class=" control-section accordion-section">179 <li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>"> 167 180 <h3 class="accordion-section-title" tabindex="0"><?php echo esc_html( $this->title ); ?></h3> 168 181 <ul class="accordion-section-content"> … … 179 192 } 180 193 } 194 195 /** 196 * Customize Panel Class. 197 * 198 * A UI container for sections, managed by the WP_Customize_Manager. 199 * 200 * @package WordPress 201 * @subpackage Customize 202 * @since 4.0.0 203 */ 204 class WP_Customize_Panel extends WP_Customize_Section { 205 206 /** 207 * Customizer sections for this panel. 208 * 209 * @since 4.0.0 210 * @access public 211 * @var array 212 */ 213 public $sections; 214 215 /** 216 * Constructor. 217 * 218 * Any supplied $args override class property defaults. 219 * 220 * @since 4.0.0 221 * 222 * @param WP_Customize_Manager $manager Customizer bootstrap instance. 223 * @param string $id An specific ID of the section. 224 * @param array $args Section arguments. 225 */ 226 public function __construct( $manager, $id, $args = array() ) { 227 parent::__construct( $manager, $id, $args ); 228 229 $this->sections = array(); // Users cannot customize the $sections array. 230 231 return $this; 232 } 233 234 /** 235 * Render the panel, and the sections that have been added to it. 236 * 237 * @since 4.0.0 238 */ 239 protected function render() { 240 ?> 241 <li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="control-section control-panel accordion-section"> 242 <h3 class="accordion-section-title" tabindex="0"><?php echo esc_html( $this->title ); ?></h3> 243 <span class="control-panel-back" tabindex="0"><span class="screen-reader-text">Back to Customize</span></span> 244 <ul class="accordion-sub-container control-panel-content"> 245 <li class="accordion-section control-section<?php if ( empty( $this->description ) ) echo ' cannot-expand'; ?>"> 246 <div class="accordion-section-title" tabindex="0"> 247 <span class="preview-notice"><?php 248 /* translators: %s is the panel title in the Customize/Live Preview pane */ 249 echo sprintf( 'You are customizing %s', '<strong class="panel-title">' . esc_html( $this->title ) . '</strong>' ); 250 ?></span> 251 </div> 252 <?php if ( ! empty( $this->description ) ) : ?> 253 <div class="accordion-section-content description"> 254 <?php echo $this->description; ?> 255 </div> 256 <?php endif; ?> 257 </li> 258 <?php 259 foreach ( $this->sections as $section ) { 260 $section->maybe_render(); 261 } 262 ?> 263 </ul> 264 </li> 265 <?php 266 } 267 }
Note: See TracChangeset
for help on using the changeset viewer.