equal
deleted
inserted
replaced
5 * @package WordPress |
5 * @package WordPress |
6 * @subpackage Administration |
6 * @subpackage Administration |
7 */ |
7 */ |
8 |
8 |
9 /** |
9 /** |
10 * Retrieve list of importers. |
10 * Retrieves the list of importers. |
11 * |
11 * |
12 * @since 2.0.0 |
12 * @since 2.0.0 |
13 * |
13 * |
14 * @global array $wp_importers |
14 * @global array $wp_importers |
15 * @return array |
15 * @return array |
21 } |
21 } |
22 return $wp_importers; |
22 return $wp_importers; |
23 } |
23 } |
24 |
24 |
25 /** |
25 /** |
26 * Sorts a multidimensional array by first member of each top level member |
26 * Sorts a multidimensional array by first member of each top level member. |
27 * |
27 * |
28 * Used by uasort() as a callback, should not be used directly. |
28 * Used by uasort() as a callback, should not be used directly. |
29 * |
29 * |
30 * @since 2.9.0 |
30 * @since 2.9.0 |
31 * @access private |
31 * @access private |
37 function _usort_by_first_member( $a, $b ) { |
37 function _usort_by_first_member( $a, $b ) { |
38 return strnatcasecmp( $a[0], $b[0] ); |
38 return strnatcasecmp( $a[0], $b[0] ); |
39 } |
39 } |
40 |
40 |
41 /** |
41 /** |
42 * Register importer for WordPress. |
42 * Registers importer for WordPress. |
43 * |
43 * |
44 * @since 2.0.0 |
44 * @since 2.0.0 |
45 * |
45 * |
46 * @global array $wp_importers |
46 * @global array $wp_importers |
47 * |
47 * |
71 function wp_import_cleanup( $id ) { |
71 function wp_import_cleanup( $id ) { |
72 wp_delete_attachment( $id ); |
72 wp_delete_attachment( $id ); |
73 } |
73 } |
74 |
74 |
75 /** |
75 /** |
76 * Handle importer uploading and add attachment. |
76 * Handles importer uploading and adds attachment. |
77 * |
77 * |
78 * @since 2.0.0 |
78 * @since 2.0.0 |
79 * |
79 * |
80 * @return array Uploaded file's details on success, error message on failure |
80 * @return array Uploaded file's details on success, error message on failure. |
81 */ |
81 */ |
82 function wp_import_handle_upload() { |
82 function wp_import_handle_upload() { |
83 if ( ! isset( $_FILES['import'] ) ) { |
83 if ( ! isset( $_FILES['import'] ) ) { |
84 return array( |
84 return array( |
85 'error' => sprintf( |
85 'error' => sprintf( |