Updates to wp 4.0.1

This commit is contained in:
nikolark committed 2014-11-26 21:10:37 +01:00
1 parent 03777ef2b0
commit 70d2335bba
184 files changed
+9953 -3052

No files matched your search

+6 -1
View File
@@ -4719,10 +4719,15 @@ function is_local_attachment($url) {
function wp_insert_attachment( $args, $file = false, $parent = 0 ) {
$defaults = array(
'file' => $file,
'post_parent' => $parent
'post_parent' => 0
);
$data = wp_parse_args( $args, $defaults );
if ( ! empty( $parent ) ) {
$data['post_parent'] = $parent;
}
$data['post_type'] = 'attachment';
return wp_insert_post( $data );