From 35fb93858a797f0ce00cd50fde4df0b02434ef44 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Mon, 7 Apr 2014 20:18:14 +0000 Subject: [PATCH] Use suggested language conventions in the hook docs description for the `theme_page_templates` filter. See #27700. Built from https://develop.svn.wordpress.org/trunk@28000 git-svn-id: http://core.svn.wordpress.org/trunk@27830 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-theme.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php index f8844d4625..6af098fe3b 100644 --- a/wp-includes/class-wp-theme.php +++ b/wp-includes/class-wp-theme.php @@ -968,7 +968,7 @@ final class WP_Theme implements ArrayAccess { $page_templates += $this->parent()->get_page_templates( $post ); /** - * Remove or rename page templates for a theme. + * Filter list of page templates for a theme. * * This filter does not currently allow for page templates to be added. * @@ -980,6 +980,7 @@ final class WP_Theme implements ArrayAccess { * @param WP_Post|null $post The post being edited, provided for context, or null. */ $return = apply_filters( 'theme_page_templates', $page_templates, $this, $post ); + return array_intersect_assoc( $return, $page_templates ); }