Add some defaults for wp_insert_attachment. fixes #6006
git-svn-id: https://develop.svn.wordpress.org/trunk@7042 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ebf8442951
commit
09ed1e62ae
|
@ -1986,7 +1986,8 @@ function wp_insert_attachment($object, $file = false, $parent = 0) {
|
||||||
|
|
||||||
$defaults = array('post_status' => 'draft', 'post_type' => 'post', 'post_author' => $user_ID,
|
$defaults = array('post_status' => 'draft', 'post_type' => 'post', 'post_author' => $user_ID,
|
||||||
'ping_status' => get_option('default_ping_status'), 'post_parent' => 0,
|
'ping_status' => get_option('default_ping_status'), 'post_parent' => 0,
|
||||||
'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => '');
|
'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => '',
|
||||||
|
'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '');
|
||||||
|
|
||||||
$object = wp_parse_args($object, $defaults);
|
$object = wp_parse_args($object, $defaults);
|
||||||
if ( !empty($parent) )
|
if ( !empty($parent) )
|
||||||
|
|
Loading…
Reference in New Issue