wp/wp-includes/class-wp-customize-section.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
child 22 8c2e4d02f4ef
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
    14  *
    14  *
    15  * @since 3.4.0
    15  * @since 3.4.0
    16  *
    16  *
    17  * @see WP_Customize_Manager
    17  * @see WP_Customize_Manager
    18  */
    18  */
       
    19 #[AllowDynamicProperties]
    19 class WP_Customize_Section {
    20 class WP_Customize_Section {
    20 
    21 
    21 	/**
    22 	/**
    22 	 * Incremented with each new class instantiation, then stored in $instance_number.
    23 	 * Incremented with each new class instantiation, then stored in $instance_number.
    23 	 *
    24 	 *
   261 	final public function check_capabilities() {
   262 	final public function check_capabilities() {
   262 		if ( $this->capability && ! current_user_can( $this->capability ) ) {
   263 		if ( $this->capability && ! current_user_can( $this->capability ) ) {
   263 			return false;
   264 			return false;
   264 		}
   265 		}
   265 
   266 
   266 		if ( $this->theme_supports && ! current_theme_supports( ... (array) $this->theme_supports ) ) {
   267 		if ( $this->theme_supports && ! current_theme_supports( ...(array) $this->theme_supports ) ) {
   267 			return false;
   268 			return false;
   268 		}
   269 		}
   269 
   270 
   270 		return true;
   271 		return true;
   271 	}
   272 	}
   354 	protected function render_template() {
   355 	protected function render_template() {
   355 		?>
   356 		?>
   356 		<li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }}">
   357 		<li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }}">
   357 			<h3 class="accordion-section-title" tabindex="0">
   358 			<h3 class="accordion-section-title" tabindex="0">
   358 				{{ data.title }}
   359 				{{ data.title }}
   359 				<span class="screen-reader-text"><?php _e( 'Press return or enter to open this section' ); ?></span>
   360 				<span class="screen-reader-text">
       
   361 					<?php
       
   362 					/* translators: Hidden accessibility text. */
       
   363 					_e( 'Press return or enter to open this section' );
       
   364 					?>
       
   365 				</span>
   360 			</h3>
   366 			</h3>
   361 			<ul class="accordion-section-content">
   367 			<ul class="accordion-section-content">
   362 				<li class="customize-section-description-container section-meta <# if ( data.description_hidden ) { #>customize-info<# } #>">
   368 				<li class="customize-section-description-container section-meta <# if ( data.description_hidden ) { #>customize-info<# } #>">
   363 					<div class="customize-section-title">
   369 					<div class="customize-section-title">
   364 						<button class="customize-section-back" tabindex="-1">
   370 						<button class="customize-section-back" tabindex="-1">
   365 							<span class="screen-reader-text"><?php _e( 'Back' ); ?></span>
   371 							<span class="screen-reader-text">
       
   372 								<?php
       
   373 								/* translators: Hidden accessibility text. */
       
   374 								_e( 'Back' );
       
   375 								?>
       
   376 							</span>
   366 						</button>
   377 						</button>
   367 						<h3>
   378 						<h3>
   368 							<span class="customize-action">
   379 							<span class="customize-action">
   369 								{{{ data.customizeAction }}}
   380 								{{{ data.customizeAction }}}
   370 							</span>
   381 							</span>
   371 							{{ data.title }}
   382 							{{ data.title }}
   372 						</h3>
   383 						</h3>
   373 						<# if ( data.description && data.description_hidden ) { #>
   384 						<# if ( data.description && data.description_hidden ) { #>
   374 							<button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text"><?php _e( 'Help' ); ?></span></button>
   385 							<button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text">
       
   386 								<?php
       
   387 								/* translators: Hidden accessibility text. */
       
   388 								_e( 'Help' );
       
   389 								?>
       
   390 							</span></button>
   375 							<div class="description customize-section-description">
   391 							<div class="description customize-section-description">
   376 								{{{ data.description }}}
   392 								{{{ data.description }}}
   377 							</div>
   393 							</div>
   378 						<# } #>
   394 						<# } #>
   379 
   395