1. 首页
  2. WordPress 函数手册

export_wp()

export_wp( array $args = array() )

生成WXR导出文件以供下载。
Generates the WXR export file for download.

目录锚点:#说明#参数#返回#源码


说明(Description)

默认行为是导出所有内容,但是,请注意,只有启用了can_export参数的post类型才会导出post内容。任何具有“自动草稿”状态的帖子都将被跳过。


参数(Parameters)

参数 类型 必填 说明
$args (array) 可选
Arguments for generating the WXR export file for download. ‘content'(string) Type of content to export. If set, only the post content of this post type will be exported. Accepts ‘all’, ‘post’, ‘page’, ‘attachment’, or a defined custom post. If an invalid custom post type is supplied, every post type for which can_export is enabled will be exported instead. If a valid custom post type is supplied but can_export is disabled, then ‘posts’ will be exported instead. When ‘all’ is supplied, only post types with can_export enabled will be exported. Default ‘all’. ‘author’(string) Author to export content for. Only used when $content is ‘post’, ‘page’, or ‘attachment’. Accepts false (all) or a specific author ID. Default false (all). 可选
‘start_date'(string) Start date to export content from. Expected date format is ‘Y-m-d’. Used only when $content is ‘post’, ‘page’ or ‘attachment’. Default false (since the beginning of time). ‘end_date’(string) End date to export content to. Expected date format is ‘Y-m-d’. Used only when $content is ‘post’, ‘page’ or ‘attachment’. Default false (latest publish date). 可选

返回(Return)

无返回值


源码(Source)


更新版本 源码位置 使用 被使用
2.1.0 wp-admin/includes/export.php:56 0 50

export_wp() 为WP2原创文章,链接:https://www.wp2.cn/functions/export_wp-2/

发表评论

您的电子邮箱地址不会被公开。