mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Rename the new page_templates filter to theme_page_templates, and pass it a post object for proper context.
see #13265. git-svn-id: https://develop.svn.wordpress.org/trunk@27470 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2948,7 +2948,7 @@ function wp_insert_post( $postarr, $wp_error = false ) {
|
||||
|
||||
if ( !empty($page_template) && 'page' == $data['post_type'] ) {
|
||||
$post->page_template = $page_template;
|
||||
$page_templates = wp_get_theme()->get_page_templates();
|
||||
$page_templates = wp_get_theme()->get_page_templates( $post );
|
||||
if ( 'default' != $page_template && ! isset( $page_templates[ $page_template ] ) ) {
|
||||
if ( $wp_error )
|
||||
return new WP_Error('invalid_page_template', __('The page template is invalid.'));
|
||||
|
||||
Reference in New Issue
Block a user