Update bonanza
This commit is contained in:
1 parent
cb55845271
commit
b6ff45d1b4
146 files changed
+15771
-14876
No files matched your search
@@ -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 );
|
||||
|
||||
Reference in new issue
Block a user