BP_REST_Signup_Endpoint:: get_item (WP_REST_Request美元的请求)
检索用户。
描述
参数
- 美元的请求
-
(WP_REST_Request)(必需)请求的全部细节。
返回
(WP_REST_Response)| WP_Error
源
文件:bp-members /类/ class-bp-rest-signup-endpoint.php
Public function get_items($request) {$args = array('include' => $request['include'], 'order' => $request['order'], 'orderby' => $request['orderby'], 'user_login' => $request['user_login'], 'number' => $request['number'], 'offset' => $request['offset'],);如果(空($request['include'])) {$args['include'] = false;} /** *过滤请求的查询参数。* * @param array $args查询变量的关键值数组。@param WP_REST_Request $request发送给API的请求。* * @since 0.1.0 */ $args = apply_filters('bp_rest_signup_get_items_query_args', $args, $request);//实际上,查询它。$args = BP_Signup::get($args);数组$ retval = ();$retval[] = $this->prepare_response_for_collection($this->prepare_item_for_response($signup, $request)); / /使用$this->prepare_response_for_collection($this->prepare_item_for_response($signup, $request); } $response = rest_ensure_response( $retval ); $response = bp_rest_response_add_total_headers( $response, $signups['total'], $args['number'] ); /** * Fires after a list of signups is fetched via the REST API. * * @param array $signups Fetched signups. * @param WP_REST_Response $response The response data. * @param WP_REST_Request $request The request sent to the API. * * @since 0.1.0 */ do_action( 'bp_rest_signup_get_items', $signups, $response, $request ); return $response; }
更新日志
版本 | 描述 |
---|---|
0.1.0 | 介绍了。 |