BP_REST_Notifications_Endpoint: get_item_schema ()

获取符合JSON模式的通知模式。

描述

返回

(数组)

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

public function get_item_schema() {$schema = array('$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'bp_notifications', 'type' => 'object', 'properties' => array('id' => array('context' => array('embed', 'view', 'edit'), 'description' => __('通知的唯一数字id。', 'buddyboss'), 'readonly' => true, 'type' => 'integer',), 'user_id' => array('context' => array('embed', 'view', 'edit'), 'description' => __('通知的用户ID。', 'buddyboss'), 'type' => 'integer', 'default' => bp_loggedin_user_id(),), 'item_id' => array('context' => array('embed', 'view', 'edit'), 'description' => __('与通知相关的项目的ID。', 'buddyboss'), 'type' => 'integer',), 'secondary_item_id' => array('context' => array('embed', 'view', 'edit'), 'description' => __('与通知相关的二级项目的ID。', 'buddyboss'), 'type' => 'integer',), 'component' => array('context' => array('embed', 'view', 'edit'), 'description' => __('通知相关的BuddyPress组件的名称。', 'buddyboss'), 'type' => 'string',), 'action' => array('context' => array('embed', 'view', 'edit'), 'description' => __('组件动作的名称通知是关于。', 'buddyboss'), 'type' => 'string',), 'date' => array('description' => __('通知创建的日期,在网站的时区。', 'buddyboss'), 'type' => 'string', 'format' => 'date-time', 'context' => array('embed', 'view', 'edit'),), 'is_new' => array('context' => array('embed', 'view', 'edit'), 'description' => __('Whether it\'s a new notification or not。', 'buddyboss'), 'type' => 'integer', 'default' => 1,), 'object' => array('context' => array('embed', 'view', 'edit'), 'description' => __('通知对象的名称。', 'buddyboss'), 'type' => 'string',), 'object_id' => array('context' => array('embed', 'view', 'edit'), 'description' => __('通知对象的ID。', 'buddyboss'), 'type' => 'integer',), 'description' => array('context' => array('embed', 'view', 'edit'), 'description' => __('通知的描述。', 'buddyboss'), 'type' => 'object', 'readonly' => true, 'properties' => array('render ' => array('description' => __('对象的HTML描述,转换为显示。', 'buddyboss'), 'type' => 'string', 'context' => array('embed', 'view', 'edit'), 'readonly' => true,),), 'link_url' => array('context' => array('embed', 'view', 'edit'), 'description' => __('链接通知URL。', 'buddyboss'), 'type' => 'string',), 'rest_actions' => array('context' => array('embed', 'view', 'edit'), 'description' => __('Rest Actions,根据状态执行接受/拒绝。', 'buddyboss'), 'type' => 'object',),),);数组$ avatar_properties = ();$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(/*翻译者:成员Avatar的拇指图像大小*/ 'description' => sprintf(__('Avatar URL与拇指图像大小(%1$d x %2$d像素))。', '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']['avatar_urls'] = array( 'description' => __( 'Avatar URLs for the notification.', 'buddyboss' ), 'type' => 'object', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, 'properties' => $avatar_properties, ); /** * Filters the notifications schema. * * @param array $schema The endpoint schema. */ return apply_filters( 'bp_rest_notification_schema', $this->add_additional_fields_schema( $schema ) ); }

更新日志

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

问题吗?

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