Changeset 14058
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/developer/execution-contexts/rest-api/reference.md
r14047 r14058 29 29 | Group Membership Requests | `/buddypress/v2/groups/<group_id>/membership-request` | 30 30 | Group Invites | `/buddypress/v2/groups/<group_id>/invites` | 31 | Private Messaging| `/buddypress/v2/messages` |31 | [Private Messaging](./messages.md) | `/buddypress/v2/messages` | 32 32 | Screen Notifications | `/buddypress/v2/notifications` | 33 33 | User Blogs | `/buddypress/v2/blogs` | -
trunk/docs/developer/manifest.json
r14047 r14058 193 193 }, 194 194 { 195 "title": "Private Messaging REST API routes", 196 "slug": "bp-rest-api-messages", 197 "markdown_source": "../developer/execution-contexts/rest-api/messages.md", 198 "parent": "bp-rest-api-reference" 199 }, 200 { 195 201 "title": "BuddyPress Functions", 196 202 "slug": "bp-functions", -
trunk/src/bp-messages/classes/class-bp-messages-rest-controller.php
r14037 r14058 63 63 $thread_endpoint, 64 64 array( 65 'args' => array( 66 'id' => array( 67 'description' => __( 'A unique numeric ID for the Thread.', 'buddypress' ), 68 'type' => 'integer', 69 ), 70 ), 65 71 array( 66 72 'methods' => WP_REST_Server::READABLE, … … 1117 1123 public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) { 1118 1124 $args = parent::get_endpoint_args_for_item_schema( $method ); 1119 $args['id']['description'] = __( ' ID of the MessagesThread.', 'buddypress' );1125 $args['id']['description'] = __( 'A unique numeric ID for the Thread.', 'buddypress' ); 1120 1126 1121 1127 if ( WP_REST_Server::CREATABLE === $method ) { … … 1123 1129 1124 1130 // Edit the Thread ID description and default properties. 1125 $args['id']['description'] = __( ' ID of the MessagesThread. Required when replying to an existing Thread.', 'buddypress' );1131 $args['id']['description'] = __( 'A unique numeric ID for the Thread. Required when replying to an existing Thread.', 'buddypress' ); 1126 1132 $args['id']['default'] = 0; 1127 1133 … … 1156 1162 1157 1163 } else { 1164 unset( $args['sender_id'], $args['subject'], $args['message'], $args['recipients'] ); 1165 1166 $args['user_id'] = array( 1167 'description' => __( 'The user ID to get the thread for.', 'buddypress' ), 1168 'required' => false, 1169 'type' => 'integer', 1170 'sanitize_callback' => 'absint', 1171 'validate_callback' => 'rest_validate_request_arg', 1172 ); 1173 1158 1174 if ( WP_REST_Server::EDITABLE === $method ) { 1175 unset( $args['message'], $args['recipients'], $args['subject'] ); 1159 1176 $key = 'update_item'; 1160 1177 … … 1188 1205 if ( WP_REST_Server::DELETABLE === $method ) { 1189 1206 $key = 'delete_item'; 1190 1191 $args['user_id'] = array(1192 'description' => __( 'The user ID to remove from the thread', 'buddypress' ),1193 'required' => true,1194 'type' => 'integer',1195 'sanitize_callback' => 'absint',1196 'validate_callback' => 'rest_validate_request_arg',1197 'default' => bp_loggedin_user_id(),1198 );1199 1200 unset( $args['sender_id'], $args['subject'], $args['message'], $args['recipients'] );1201 1207 } 1202 1208 1203 1209 if ( WP_REST_Server::READABLE === $method ) { 1204 unset( $args['sender_id'], $args['subject'], $args['message'], $args['recipients'] );1205 1206 1210 $key = 'get_item'; 1207 1208 $args['user_id'] = array(1209 'description' => __( 'The user ID to get the thread for.', 'buddypress' ),1210 'required' => false,1211 'type' => 'integer',1212 'sanitize_callback' => 'absint',1213 'validate_callback' => 'rest_validate_request_arg',1214 );1215 1211 1216 1212 $args['recipients_page'] = array( … … 1291 1287 'context' => array( 'view', 'edit' ), 1292 1288 'description' => __( 'A unique numeric ID for the Thread.', 'buddypress' ), 1289 'readonly' => true, 1293 1290 'type' => 'integer', 1294 1291 ), … … 1376 1373 'date' => array( 1377 1374 'context' => array( 'view', 'edit' ), 1378 'description' => __( 'Dat of the latest message of the Thread, in the site\'s timezone.', 'buddypress' ),1375 'description' => __( 'Date of the latest message of the Thread, in the site\'s timezone.', 'buddypress' ), 1379 1376 'readonly' => true, 1380 1377 'type' => array( 'string', 'null' ), … … 1405 1402 'recipients' => array( 1406 1403 'context' => array( 'view', 'edit' ), 1407 'description' => __( 'The list of recipient User Objectsinvolved into the Thread.', 'buddypress' ),1404 'description' => __( 'The list of Avatar URLs for the recipient involved into the Thread.', 'buddypress' ), 1408 1405 'type' => 'array', 1409 1406 'items' => array(
Note: See TracChangeset
for help on using the changeset viewer.