BP_REST_Forums_Endpoint: get_collection_params ()

获取集合的查询参数。

描述

返回

(数组)

文件:bp-forums /类/ class-bp-rest-forums-endpoint.php

Public function get_collection_params() {$params = parent::get_collection_params();$ params['环境'](“违约”)=“视图”;$params['per_page']['default'] = (function_exists('bbp_get_forums_per_page')) ?Bbp_get_forums_per_page (): get_option('_bbp_forums_per_page', 15);$params['author'] = array('description' => __('author ID,或逗号分隔的ID列表。', 'buddyboss'), 'default' => ', 'type' => 'string', 'sanitize_callback' => 'sanitize_key', 'validate_callback' => 'rest_validate_request_arg',);$params['author_exclude'] = array('description' => __('不查询的作者id数组。', 'buddyboss'), 'type' => 'array', 'items' => array('type' => 'integer'), 'sanitize_callback' => 'wp_parse_id_list', 'validate_callback' => 'rest_validate_request_arg',);$params['exclude'] = array('description' => __('一个不需要检索的论坛id数组。', 'buddyboss'), 'type' => 'array', 'items' => array('type' => 'integer'), 'sanitize_callback' => 'wp_parse_id_list', 'validate_callback' => 'rest_validate_request_arg',); $params['include'] = array( 'description' => __( 'An array of forums IDs to retrieve.', 'buddyboss' ), 'type' => 'array', 'items' => array( 'type' => 'integer' ), 'sanitize_callback' => 'wp_parse_id_list', 'validate_callback' => 'rest_validate_request_arg', ); $params['offset'] = array( 'description' => __( 'The number of forums to offset before retrieval.', 'buddyboss' ), 'type' => 'integer', 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg', ); $params['order'] = array( 'description' => __( 'Designates ascending or descending order of forums.', 'buddyboss' ), 'default' => 'asc', 'type' => 'string', 'enum' => array( 'asc', 'desc' ), 'sanitize_callback' => 'sanitize_key', 'validate_callback' => 'rest_validate_request_arg', ); $params['orderby'] = array( 'description' => __( 'Sort retrieved forums by parameter.', 'buddyboss' ), 'type' => 'array', 'items' => array( 'type' => 'string', 'enum' => array( 'date', 'ID', 'author', 'title', 'name', 'modified', 'parent', 'rand', 'menu_order', 'relevance', 'popular', 'activity', ), ), 'sanitize_callback' => 'bp_rest_sanitize_string_list', 'validate_callback' => 'rest_validate_request_arg', ); $params['status'] = array( 'description' => __( 'Limit result set to forums assigned a specific status.', 'buddyboss' ), 'default' => array( 'publish', 'private' ), 'type' => 'array', 'items' => array( 'type' => 'string', 'enum' => array( 'publish', 'private', 'hidden' ), ), 'sanitize_callback' => 'bp_rest_sanitize_string_list', 'validate_callback' => 'rest_validate_request_arg', ); $params['parent'] = array( 'description' => __( 'Forum ID to retrieve child pages for. Use 0 to only retrieve top-level forums.', 'buddyboss' ), 'default' => '0', 'type' => 'integer', 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg', ); $params['subscriptions'] = array( 'description' => __( 'Retrieve subscribed forums by user.', 'buddyboss' ), 'default' => false, 'type' => 'boolean', 'validate_callback' => 'rest_validate_request_arg', ); /** * Filters the collection query params. * * @param array $params Query params. */ return apply_filters( 'bp_rest_forums_collection_params', $params ); }

更新日志

更新日志
版本 描述
0.1.0 介绍了。

问题吗?

我们总是很乐意帮助您解决代码或其他问题!搜索我们的开发人员文档联络支持,或与我们联系销售团队