BP_REST_媒体_相册_端点::获取项目(WP_REST_请求$request)

检索相册。

描述

参数

$request

(WP_REST_请求)(必选)有关请求的完整详细信息。

回来

(WP_REST_Response)|WP_误差

来源

文件:bp media/classes/class-bp-rest-media-albums-endpoint.php

公共函数get_items($request){$args=array('page'=>$request['page'],'per_page'=>$request['per_page'],'sort'=>$request['order'],'order_'=>$request['orderby'],'count_total'=>$request['count_total'],'fields'=>'all',);if(!empty(!empty($request['search['search'])){)$args['search\'terms['search'])=$request['search'];if(!empty)}($request['max']){$args['max']=$request['max']}如果(!empty($request['user_id']){$args['user_id']=$request['user_id'];}如果(!empty($request['group_id']){$args['group_id']=$request['group_id']}如果(!empty($request['privacy']){$args['privacy']}不包括(!empty($args['privacy'])request[]{$args['exclude']=$request['exclude'];}如果(!empty($request['include']){$args['album_id']=$request['include'];}/***过滤请求的查询参数。**@param数组$args查询变量的键值数组到查询值。*@param WP_REST_request$请求发送到API的请求。**@0.1.0以来*/$args=apply_过滤器('bp_REST_media_相册_get_items_query_args',$args,$request);$medias=$this->汇编_response_数据($args)$retval=array();foreach($medias['albums']as$album){$retval[]=$this->prepare_response_for_collection($this->prepare_item_for_response($album,$request));$response=rest_sure_response($retval);$response=bp_rest___response__response_回复_添加_总计_标题($response,$medias['total'],$args['per_;/***在通过REST API获取成员列表后激发。**@param array$media fetched media Albums.*@param WP_REST_Response$Response响应数据。*@param WP_REST_Request$Request请求发送到API的请求。**@自0.1.0以来*/do_操作('bp_REST_media_media_Albums_get_items',$medias$Response,$Request);return$Response;}

变更日志

变更日志
版本 描述
0.1.0 介绍。

问题?

我们随时乐意为您提供代码或其他问题的帮助!搜索我们的开发者文档,联系支持,或与我们的销售团队.