Update bonanza

This commit is contained in:
nikolark committed 2014-11-20 21:01:19 +01:00
1 parent cb55845271
commit b6ff45d1b4
146 files changed
+15771 -14876

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 );