Commit a6c3932a authored by Andrew Nacin's avatar Andrew Nacin
Browse files

Add a filter to remove or rename page templates for a theme. This does not yet...

Add a filter to remove or rename page templates for a theme. This does not yet handle adding page templates. see #13265.

Built from https://develop.svn.wordpress.org/trunk@27297


git-svn-id: https://core.svn.wordpress.org/trunk@27152 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent 0bab7fa4
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -963,7 +963,19 @@ final class WP_Theme implements ArrayAccess {
		if ( $this->parent() )
			$page_templates += $this->parent()->get_page_templates();

		return $page_templates;
		/**
		 * Remove or rename page templates for a theme.
		 *
		 * This filter does not currently allow for page templates to be added.
		 *
		 * @since 3.9.0
		 *
		 * @param array    $page_templates Array of page templates. Keys are filenames,
		 *                                 values are translated names.
		 * @param WP_Theme $this           The theme object.
		 */
		$return = apply_filters( 'page_templates', $page_templates, $this );
		return array_intersect_assoc( $return, $page_templates );
	}

	/**