mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-05 05:04:31 +00:00
Don't hard code post type in edit forms. Props filosofo and DD32. fixes #4991
git-svn-id: https://develop.svn.wordpress.org/trunk@6712 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -143,6 +143,7 @@ function get_default_post_to_edit() {
|
||||
$post_excerpt = '';
|
||||
|
||||
$post->post_status = 'draft';
|
||||
$post->post_type = 'post';
|
||||
$post->comment_status = get_option( 'default_comment_status' );
|
||||
$post->ping_status = get_option( 'default_ping_status' );
|
||||
$post->post_pingback = get_option( 'default_pingback_flag' );
|
||||
@@ -157,6 +158,12 @@ function get_default_post_to_edit() {
|
||||
return $post;
|
||||
}
|
||||
|
||||
function get_default_page_to_edit() {
|
||||
$page = get_default_post_to_edit();
|
||||
$page->post_type = 'page';
|
||||
return $page;
|
||||
}
|
||||
|
||||
// Get an existing post and format it for editing.
|
||||
function get_post_to_edit( $id ) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user