Rename the new page_templates filter to theme_page_templates, and pass it a post object for proper context.
see #13265. Built from https://develop.svn.wordpress.org/trunk@27470 git-svn-id: http://core.svn.wordpress.org/trunk@27315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -78,10 +78,11 @@ function delete_theme($stylesheet, $redirect = '') {
|
||||
*
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @param WP_Post|null $post Optional. The post being edited, provided for context.
|
||||
* @return array Key is the template name, value is the filename of the template
|
||||
*/
|
||||
function get_page_templates() {
|
||||
return array_flip( wp_get_theme()->get_page_templates() );
|
||||
function get_page_templates( $post = null ) {
|
||||
return array_flip( wp_get_theme()->get_page_templates( $post ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user