In get_default_post_to_edit()
, let 'post_name' be passed to filter.
Previously, it was being overridden after the default post had been inserted into the database, making it cumbersome to override with the 'wp_insert_post_data' filter. Props danielbachhuber. Fixes #29847. git-svn-id: https://develop.svn.wordpress.org/trunk@30626 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a989ce280b
commit
11ef3c3ee6
@ -555,6 +555,7 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
|
||||
$post->post_date = '';
|
||||
$post->post_date_gmt = '';
|
||||
$post->post_password = '';
|
||||
$post->post_name = '';
|
||||
$post->post_type = $post_type;
|
||||
$post->post_status = 'draft';
|
||||
$post->to_ping = '';
|
||||
@ -598,7 +599,6 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
|
||||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
$post->post_excerpt = apply_filters( 'default_excerpt', $post_excerpt, $post );
|
||||
$post->post_name = '';
|
||||
|
||||
return $post;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user