~canonical-sysadmins/wordpress/4.7

« back to all changes in this revision

Viewing changes to wp-admin/includes/export.php

  • Committer: Haw Loeung
  • Date: 2016-12-13 06:56:21 UTC
  • mfrom: (1.1.20 upstream)
  • Revision ID: haw.loeung@canonical.com-20161213065621-8tcu7u7vlxgs2s81
Merge WP4.7 from upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
/**
19
19
 * Generates the WXR export file for download.
20
20
 *
 
21
 * Default behavior is to export all content, however, note that post content will only
 
22
 * be exported for post types with the `can_export` argument enabled. Any posts with the
 
23
 * 'auto-draft' status will be skipped.
 
24
 *
21
25
 * @since 2.1.0
22
26
 *
23
 
 * @global wpdb    $wpdb
24
 
 * @global WP_Post $post
25
 
 *
26
 
 * @param array $args Filters defining what should be included in the export.
 
27
 * @global wpdb    $wpdb WordPress database abstraction object.
 
28
 * @global WP_Post $post Global `$post`.
 
29
 *
 
30
 * @param array $args {
 
31
 *     Optional. Arguments for generating the WXR export file for download. Default empty array.
 
32
 *
 
33
 *     @type string $content        Type of content to export. If set, only the post content of this post type
 
34
 *                                  will be exported. Accepts 'all', 'post', 'page', 'attachment', or a defined
 
35
 *                                  custom post. If an invalid custom post type is supplied, every post type for
 
36
 *                                  which `can_export` is enabled will be exported instead. If a valid custom post
 
37
 *                                  type is supplied but `can_export` is disabled, then 'posts' will be exported
 
38
 *                                  instead. When 'all' is supplied, only post types with `can_export` enabled will
 
39
 *                                  be exported. Default 'all'.
 
40
 *     @type string $author         Author to export content for. Only used when `$content` is 'post', 'page', or
 
41
 *                                  'attachment'. Accepts false (all) or a specific author ID. Default false (all).
 
42
 *     @type string $category       Category (slug) to export content for. Used only when `$content` is 'post'. If
 
43
 *                                  set, only post content assigned to `$category will be exported. Accepts false
 
44
 *                                  or a specific category slug. Default is false (all categories).
 
45
 *     @type string $start_date     Start date to export content from. Expected date format is 'Y-m-d'. Used only
 
46
 *                                  when `$content` is 'post', 'page' or 'attachment'. Default false (since the
 
47
 *                                  beginning of time).
 
48
 *     @type string $end_date       End date to export content to. Expected date format is 'Y-m-d'. Used only when
 
49
 *                                  `$content` is 'post', 'page' or 'attachment'. Default false (latest publish date).
 
50
 *     @type string $status         Post status to export posts for. Used only when `$content` is 'post' or 'page'.
 
51
 *                                  Accepts false (all statuses except 'auto-draft'), or a specific status, i.e.
 
52
 *                                  'publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit', or
 
53
 *                                  'trash'. Default false (all statuses except 'auto-draft').
 
54
 * }
27
55
 */
28
56
function export_wp( $args = array() ) {
29
57
        global $wpdb, $post;
325
353
        }
326
354
 
327
355
        /**
328
 
         * Ouput all navigation menu terms
 
356
         * Output all navigation menu terms
329
357
         *
330
358
         * @since 3.1.0
331
359
         */