WP_Customize_Section::render_template() WordPress Method

The WP_Customize_Section::render_template() method is used to render the template for a given section. This is typically done by including the template file specified by the 'template' attribute of the section.

WP_Customize_Section::render_template() #

An Underscore (JS) template for rendering this section.


Description

Class variables for this section class are available in the data JS object; export custom variables by overriding WP_Customize_Section::json().

Top ↑

See also


Top ↑

Source

File: wp-includes/class-wp-customize-section.php

354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
protected function render_template() {
    ?>
    <li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }}">
        <h3 class="accordion-section-title" tabindex="0">
            {{ data.title }}
            <span class="screen-reader-text"><?php _e( 'Press return or enter to open this section' ); ?></span>
        </h3>
        <ul class="accordion-section-content">
            <li class="customize-section-description-container section-meta <# if ( data.description_hidden ) { #>customize-info<# } #>">
                <div class="customize-section-title">
                    <button class="customize-section-back" tabindex="-1">
                        <span class="screen-reader-text"><?php _e( 'Back' ); ?></span>
                    </button>
                    <h3>
                        <span class="customize-action">
                            {{{ data.customizeAction }}}
                        </span>
                        {{ data.title }}
                    </h3>
                    <# if ( data.description && data.description_hidden ) { #>
                        <button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text"><?php _e( 'Help' ); ?></span></button>
                        <div class="description customize-section-description">
                            {{{ data.description }}}
                        </div>
                    <# } #>
 
                    <div class="customize-control-notifications-container"></div>
                </div>
 
                <# if ( data.description && ! data.description_hidden ) { #>
                    <div class="description customize-section-description">
                        {{{ data.description }}}
                    </div>
                <# } #>
            </li>
        </ul>
    </li>
    <?php
}


Top ↑

Changelog

Changelog
VersionDescription
4.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by the Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.