IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
35 | 35 | |
36 | 36 | function create_upload_object( $file, $parent = 0 ) { |
37 | 37 | $contents = file_get_contents( $file ); |
38 | | $upload = wp_upload_bits( basename( $file ), null, $contents ); |
| 38 | $upload = wp_upload_bits( wp_basename( $file ), null, $contents ); |
39 | 39 | |
40 | 40 | $type = ''; |
41 | 41 | if ( ! empty( $upload['type'] ) ) { |
… |
… |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | $attachment = array( |
51 | | 'post_title' => basename( $upload['file'] ), |
| 51 | 'post_title' => wp_basename( $upload['file'] ), |
52 | 52 | 'post_content' => '', |
53 | 53 | 'post_type' => 'attachment', |
54 | 54 | 'post_parent' => $parent, |