BP_REST_XProfile_Update_Endpoint: get_collection_params ()

获取XProfile更新的查询参数。

描述

返回

(数组)

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

公共函数get_collection_params(){$ params = parent :: get_collection_params();$ params ['context'] ['默认'] ='编辑';$ params ['字段'] = array('description'=> __('field_id,group_id,type,value和desifatience_level的字段数组,以更新数据。','buddyboss'),'type'=>'数组','项目'=>数组('类型'=>'对象'),'默认'=>数组(数组('field_id'=>''','group_id'=>''','值'=>'','visibility_level' => '', ), ), 'required' => true, 'properties' => array( 'field_id' => array( 'description' => __( 'The ID of the field the data is from.', 'buddyboss' ), 'type' => 'integer', 'required' => true, 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg', ), 'group_id' => array( 'description' => __( 'ID of the profile group of fields that have profile fields', 'buddyboss' ), 'default' => 0, 'type' => 'integer', 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg', ), 'value' => array( 'description' => __( 'The value of the field data.', 'buddyboss' ), ), 'visibility_level' => array( 'description' => __( 'Who may see the saved value for this profile field.', 'buddyboss' ), 'default' => 'public', 'type' => 'string', 'enum' => array_keys( bp_xprofile_get_visibility_levels() ), ), ), ); $params['profile_group_id'] = array( 'description' => __( 'ID of the field group that have fields.', 'buddyboss' ), 'default' => 0, 'type' => 'integer', 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg', ); $params['hide_empty_groups'] = array( 'description' => __( 'Whether to hide profile groups of fields that do not have any profile fields or not.', 'buddyboss' ), 'default' => false, 'type' => 'boolean', 'sanitize_callback' => 'rest_sanitize_boolean', 'validate_callback' => 'rest_validate_request_arg', ); $params['member_type'] = array( 'description' => __( 'Limit fields by those restricted to a given member type, or array of member types. If `$user_id` is provided, the value of `$member_type` will be overridden by the member types of the provided user. The special value of \'any\' will return only those fields that are unrestricted by member type - i.e., those applicable to any type.', 'buddyboss' ), 'default' => array(), 'type' => 'array', 'items' => array( 'type' => 'string' ), 'sanitize_callback' => 'bp_rest_sanitize_member_types', 'validate_callback' => 'bp_rest_validate_member_types', ); $params['hide_empty_fields'] = array( 'description' => __( 'Whether to hide profile groups of fields that do not have any profile fields or not.', 'buddyboss' ), 'default' => false, 'type' => 'boolean', 'sanitize_callback' => 'rest_sanitize_boolean', 'validate_callback' => 'rest_validate_request_arg', ); $params['fetch_fields'] = array( 'description' => __( 'Whether to fetch the fields for each group.', 'buddyboss' ), 'default' => true, 'type' => 'boolean', 'sanitize_callback' => 'rest_sanitize_boolean', 'validate_callback' => 'rest_validate_request_arg', ); $params['fetch_field_data'] = array( 'description' => __( 'Whether to fetch data for each field. Requires a $user_id.', 'buddyboss' ), 'default' => true, 'type' => 'boolean', 'sanitize_callback' => 'rest_sanitize_boolean', 'validate_callback' => 'rest_validate_request_arg', ); $params['fetch_visibility_level'] = array( 'description' => __( 'Whether to fetch the visibility level for each field.', 'buddyboss' ), 'default' => true, 'type' => 'boolean', 'sanitize_callback' => 'rest_sanitize_boolean', 'validate_callback' => 'rest_validate_request_arg', ); $params['exclude_groups'] = array( 'description' => __( 'Ensure result set excludes specific profile field groups.', 'buddyboss' ), 'default' => array(), 'type' => 'array', 'items' => array( 'type' => 'integer' ), 'sanitize_callback' => 'bp_rest_sanitize_string_list', 'validate_callback' => 'rest_validate_request_arg', ); $params['exclude_fields'] = array( 'description' => __( 'Ensure result set excludes specific profile fields.', 'buddyboss' ), 'default' => array(), 'type' => 'array', 'items' => array( 'type' => 'string' ), 'sanitize_callback' => 'bp_rest_sanitize_string_list', 'validate_callback' => 'rest_validate_request_arg', ); $params['update_meta_cache'] = array( 'description' => __( 'Whether to pre-fetch xprofilemeta for all retrieved groups, fields, and data.', 'buddyboss' ), 'default' => true, 'type' => 'boolean', 'sanitize_callback' => 'rest_sanitize_boolean', 'validate_callback' => 'rest_validate_request_arg', ); /** * Filters the collection query params. * * @param array $params Query params. */ return apply_filters( 'bp_rest_xprofile_update_collection_params', $params ); }

更新日志

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

问题吗?

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