宇筱博客

  • 解决办法
  • 学无止境
  • 记录时光
  • 百宝箱
宇筱博客
点滴记忆,汇聚成海。
  1. 首页
  2. 正文

一个文章对象(与数据库wp_posts表中的字段一一对应)

2022年1月25日 51点热度 0人点赞 0条评论
##一个文章对象(与数据库wp_posts表中的字段一一对应)##
$post = array(
'ID' => [ <post id> ] //需要更新的文章编号
'menu_order' => [ <order> ] //如果新文章是页面,设置显示顺序
'comment_status' => [ 'closed' | 'open' ] // 评论的状态,'closed'关闭评论.
'ping_status' => [ 'closed' | 'open' ] // ping的状态,'closed' 关闭 pingbacks和trackbacks
'pinged' => [ ? ] //该文章被ping到的地址
'post_author' => [ <user ID> ] //作者编号
'post_category' => [ array(<category id>, <...>) ] //文章归类数组
'post_content' => [ <the text of the post> ] //文章内容,必填
'post_date' => [ Y-m-d H:i:s ] //文章编辑日期
'post_date_gmt' => [ Y-m-d H:i:s ] //文章编辑GMT日期
'post_excerpt' => [ <an excerpt> ] //摘要信息
'post_name' => [ <the name> ] // (slug) 文章别名
'post_parent' => [ <post ID> ] //新文章的父文章编号
'post_password' => [ ? ] //文章浏览密码
'post_status' => [ 'draft' | 'publish' | 'pending'| 'future' | 'private' ] //新文章的状态
'post_title' => [ <the title> ] //文章标题,必填
'post_type' => [ 'post' | 'page' | 'link' | 'nav_menu_item' | custom post type ] //文章类型:文章、页面、链接、菜单、其他定制类型
'tags_input' => [ '<tag>, <tag>, <...>' ] //标签字符串
'to_ping' => [ ? ] //该文章需要ping到的地址
'tax_input' => [ array( 'taxonomy_name' => array( 'term', 'term2', 'term3' ) ) ] // 附加注释数组
);

原文链接:https://blog.csdn.net/vawe86/article/details/84488634

Post Views: 137
标签: 暂无
最后更新:2022年1月25日

小渔民

这个人很懒,什么都没留下

点赞

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2023 渔人码头. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

豫ICP备15017825号-2