Customize: Ease extendability of filter drawer
By moving the `wporg` conditional inside the method body, the filter drawer can be overridden without having to also override the entire section template. Props celloexpressions. Closes #42212. git-svn-id: https://develop.svn.wordpress.org/trunk@41973 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9dc63e7cab
commit
fbf27f0c23
|
@ -80,9 +80,7 @@ class WP_Customize_Themes_Section extends WP_Customize_Section {
|
||||||
<div class="customize-preview-header themes-filter-bar">
|
<div class="customize-preview-header themes-filter-bar">
|
||||||
<?php $this->filter_bar_content_template(); ?>
|
<?php $this->filter_bar_content_template(); ?>
|
||||||
</div>
|
</div>
|
||||||
<# if ( 'wporg' === data.action ) { #>
|
|
||||||
<?php $this->filter_drawer_content_template(); ?>
|
<?php $this->filter_drawer_content_template(); ?>
|
||||||
<# } #>
|
|
||||||
<div class="error unexpected-error" style="display: none; "><p><?php _e( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ); ?></p></div>
|
<div class="error unexpected-error" style="display: none; "><p><?php _e( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ); ?></p></div>
|
||||||
<ul class="themes">
|
<ul class="themes">
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -150,7 +148,6 @@ class WP_Customize_Themes_Section extends WP_Customize_Section {
|
||||||
/**
|
/**
|
||||||
* Render the filter drawer portion of a themes section as a JS template.
|
* Render the filter drawer portion of a themes section as a JS template.
|
||||||
*
|
*
|
||||||
* The template is only rendered by PHP once, so all actions are prepared at once on the server side.
|
|
||||||
* The filter bar container is rendered by @see `render_template()`.
|
* The filter bar container is rendered by @see `render_template()`.
|
||||||
*
|
*
|
||||||
* @since 4.9.0
|
* @since 4.9.0
|
||||||
|
@ -158,6 +155,7 @@ class WP_Customize_Themes_Section extends WP_Customize_Section {
|
||||||
protected function filter_drawer_content_template() {
|
protected function filter_drawer_content_template() {
|
||||||
$feature_list = get_theme_feature_list( false ); // @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 ); // @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.
|
||||||
?>
|
?>
|
||||||
|
<# if ( 'wporg' === data.action ) { #>
|
||||||
<div class="filter-drawer filter-details">
|
<div class="filter-drawer filter-details">
|
||||||
<?php foreach ( $feature_list as $feature_name => $features ) : ?>
|
<?php foreach ( $feature_list as $feature_name => $features ) : ?>
|
||||||
<fieldset class="filter-group">
|
<fieldset class="filter-group">
|
||||||
|
@ -171,6 +169,7 @@ class WP_Customize_Themes_Section extends WP_Customize_Section {
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
|
<# } #>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue