$个参数
阵列必修的方法参数。注意:参数必须按照文档排序。
- 整数
博客ID(未使用)。
1
整数帖子ID。
2
一串用户名。
三
一串密码。
4
一串内容
5
整数发布标志。0表示草稿,1表示发布。
公共功能blogger_editPost($args){$this->escape($args);$post_id=(int)$args[1];$username=$args[2];$password=$args[3];$content=$args[4];$publish=$args[5];$user=$this->登录($username,$password);if(!$user){返回$this->错误;}/**此操作记录在wp-includes/class-wp-xmlrpc-server.php中*/do_action('xmlrpc_call','blogger.editPost',$args,$this);$actual_post=获取post($post_id,ARRAY_A);if(!$actual_post||'post'!==$actual_post['post_type']){return new IXR_Error(404,__('对不起,没有这样的帖子');}$this->escape($actual_post);if(!current_user_can('edit_post',$post_id)){return new IXR_Error(401,__('对不起,您不能编辑此帖子。'));}if('publish'===$actual_post['post_status']&&!current_user_can('publishe_posts')){return new IXR_Error(401,__('对不起,您不能发布此帖子。'));}$postdata=array();$postdata['ID']=$actual_post['ID'];$postdata['post_content']=xmlrpc_removepostdata($content);$postdata['post_title']=xmlrpc_getposttitle($content);$postdata['post_category']=xmlrpc_getpostcategory($content);$postdata['post_status']=$actual_post['post_status'];$postdata['post_excerpt']=$actual_post['pose_excerpt'];$postdata['post_status']=$publish?'publish':'草稿';$result=wp_update_post($postdata);if(!$result){return new IXR_Error(500,__('对不起,文章无法更新。'));}$this->attach_uploads($actual_post['ID'],$postdata['post_content']);/***通过XML-RPC Blogger API成功更新帖子后激发。**@自3.4.0起**@param int$post_id更新帖子的id。*@param array$args要编辑的帖子的参数数组。*/do_action('xmlrpc_call_success_blogger_editPost',$post_id,$args);//phpcs:忽略WordPress。命名约定。有效挂钩名称。无小写返回true;}
查看所有引用 在Trac上查看 在GitHub上查看