From fbf27f0c2322add0e3b2002a069819437cc6bb26 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Mon, 23 Oct 2017 18:57:46 +0000 Subject: [PATCH] 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 --- .../class-wp-customize-themes-section.php | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/wp-includes/customize/class-wp-customize-themes-section.php b/src/wp-includes/customize/class-wp-customize-themes-section.php index b89e6b55ea..40f5b38123 100644 --- a/src/wp-includes/customize/class-wp-customize-themes-section.php +++ b/src/wp-includes/customize/class-wp-customize-themes-section.php @@ -80,9 +80,7 @@ class WP_Customize_Themes_Section extends WP_Customize_Section {
filter_bar_content_template(); ?>
- <# if ( 'wporg' === data.action ) { #> - filter_drawer_content_template(); ?> - <# } #> + filter_drawer_content_template(); ?> @@ -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. * - * 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()`. * * @since 4.9.0 @@ -158,19 +155,21 @@ class WP_Customize_Themes_Section extends WP_Customize_Section { 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. ?> -
- $features ) : ?> -
- -
- $feature_name ) : ?> - -
- -
-
- -
+ <# if ( 'wporg' === data.action ) { #> +
+ $features ) : ?> +
+ +
+ $feature_name ) : ?> + +
+ +
+
+ +
+ <# } #>