get_default_post_to_edit()
get_default_post_to_edit( string $post_type = ‘post’, bool $create_in_db = false )
填充“写文章”表单时使用的默认文章信息。
Default post information to use when populating the “Write Post” form.
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$post_type | (string) | 可选 | post类型字符串。 |
$create_in_db | (bool) | 可选 | 是否将文章插入数据库。 |
返回(Return)
(WP_Post)包含所有默认Post数据作为属性的Post对象
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
2.0.0 | wp-admin/includes/post.php:653 | 5 | 17 |
get_default_post_to_edit() 为WP2原创文章,链接:https://www.wp2.cn/functions/get_default_post_to_edit/