WP_Customize_Themes_Section::filter_drawer_content_template() WordPress Method

The WP_Customize_Themes_Section::filter_drawer_content_template() method is used to filter the content of the themes drawer in the Customizer.

WP_Customize_Themes_Section::filter_drawer_content_template() #

Render the filter drawer portion of a themes section as a JS template.


Description

The filter bar container is rendered by @see render_template().


Top ↑

Source

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

	protected function filter_drawer_content_template() {
		// @todo Use the .org API instead of the local core feature list.
		// The .org API is currently outdated and will be reconciled when the .org themes directory is next redesigned.
		$feature_list = get_theme_feature_list( false );
		?>
		<# if ( 'wporg' === data.action ) { #>
			<div class="filter-drawer filter-details">
				<?php foreach ( $feature_list as $feature_name => $features ) : ?>
					<fieldset class="filter-group">
						<legend><?php echo esc_html( $feature_name ); ?></legend>
						<div class="filter-group-feature">
							<?php foreach ( $features as $feature => $feature_name ) : ?>
								<input type="checkbox" id="filter-id-<?php echo esc_attr( $feature ); ?>" value="<?php echo esc_attr( $feature ); ?>" />
								<label for="filter-id-<?php echo esc_attr( $feature ); ?>"><?php echo esc_html( $feature_name ); ?></label>
							<?php endforeach; ?>
						</div>
					</fieldset>
				<?php endforeach; ?>
			</div>
		<# } #>
		<?php
	}


Top ↑

Changelog

Changelog
VersionDescription
4.9.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.