BP_REST_Members_Actions_Endpoint: get_item_schema ()
获取符合JSON模式的成员动作模式。
描述
返回
(数组)
源
文件:bp-members /类/ class-bp-rest-members-actions-endpoint.php
public function get_item_schema() {$schema = array('$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'bp_members_action', 'type' => 'object', 'properties' => array('action' => array('description' => __('action' => ' array('description' => __('action' => '));', 'buddyboss'), 'type' => 'boolean', 'context' => array('edit'), 'readonly' => true,), 'data' => array('description' => __('对象的成员。', 'buddyboss'), 'type' => 'object', 'context' => array('edit'), 'readonly' => true, 'properties' => array('id' => array('description' => __('成员的唯一数字id。', 'buddyboss'), 'type' => 'integer', 'context' => array('embed', 'view', 'edit'), 'readonly' => true,), 'name' => array('description' => __('显示成员的名称。', 'buddyboss'), 'type' => 'string', 'context' => array('embed', 'view', 'edit'), 'arg_options' => array('sanitize_callback' => 'sanitize_text_field',),), 'mention_name' => array('description' => __(' @-mentions用户使用的名字。', 'buddyboss'), 'type' => 'string', 'context' => array('embed', 'view', 'edit'), 'arg_options' => array('sanitize_callback' => 'sanitize_text_field',),), 'link' => array('description' => __('Profile URL的成员。', 'buddyboss'), 'type' => 'string', 'format' => 'uri', 'context' => array('embed', 'view', 'edit'), 'readonly' => true,), 'user_login' => array('description' => __(' Member '的字母数字标识符。', 'buddyboss'), 'type' => 'string', 'context' => array('embed', 'view', 'edit'), 'required' => true, 'arg_options' => array('sanitize_callback' => array($this, 'check_username'),), 'member_types' => array('description' => __('成员类型与成员关联。', 'buddyboss'), 'type' => 'object', 'context' => array('embed', 'view', 'edit'), 'readonly' => true,), 'xprofile' => array('description' => __('Member xprofile groups and its fields。', 'buddyboss'), 'type' => 'array', 'context' => array('view', 'edit'), 'readonly' => true,), 'friendship_status' => array('description' => __('当前登录用户的友谊关系。'type' => 'string', 'context' => array('embed', 'view', 'edit'), 'readonly' => true, 'enum' => array('is_friends', 'not_friends', 'pending', 'awaiting_response'),), 'is_following' => array('description' => __('检查用户是否跟随。”、“buddyboss‘)’,' = > '布尔型”、“上下文”= >数组(“嵌入”、“视图”,“编辑”),“只读”= > true , ), ), ), ), );/ /阿凡达。If (true === buddypress()->avatar->show_avatars) {$avatar_properties = array();$avatar_properties['full'] = array(/*翻译器:成员Avatar的完整图像大小*/ 'description' => sprintf(__('Avatar URL与完整图像大小(%1$d x %2$d像素))。', 'buddyboss'), number_format_i18n(bp_core_avatar_full_width()), number_format_i18n(bp_core_avatar_full_height())), 'type' => 'string', 'format' => 'uri', 'context' => array('embed', 'view', 'edit'),); $avatar_properties['thumb'] = array( /* translators: Thumb imaze size for the member Avatar */ 'description' => sprintf( __( 'Avatar URL with thumb image size (%1$d x %2$d pixels).', 'buddyboss' ), number_format_i18n( bp_core_avatar_thumb_width() ), number_format_i18n( bp_core_avatar_thumb_height() ) ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'embed', 'view', 'edit' ), ); $schema['properties']['data']['avatar_urls'] = array( 'description' => __( 'Avatar URLs for the member.', 'buddyboss' ), 'type' => 'object', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, 'properties' => $avatar_properties, ); } $schema['properties']['data']['cover_url'] = array( 'description' => __( 'Cover images URL for the member.', 'buddyboss' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ); /** * Filters the members action schema. * * @param array $schema The endpoint schema. */ return apply_filters( 'bp_rest_members_action_schema', $this->add_additional_fields_schema( $schema ) ); }
更新日志
版本 | 描述 |
---|---|
0.1.0 | 介绍了。 |