Changeset 9862 for trunk/src/bp-messages/bp-messages-functions.php
- Timestamp:
- 05/12/2015 04:39:07 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/bp-messages-functions.php
r9845 r9862 2 2 3 3 /** 4 * BuddyPress Messages Functions 4 * BuddyPress Messages Functions. 5 5 * 6 6 * Business functions are where all the magic happens in BuddyPress. They will … … 19 19 * Create a new message. 20 20 * 21 * @param array $args {21 * @param array|string $args { 22 22 * Array of arguments. 23 * @type int $sender_id Optional. ID of the user who is sending the 24 * message. Default: ID of the logged-in user. 25 * @type int $thread_id Optional. ID of the parent thread. Leave blank to 26 * create a new thread for the message. 27 * @type array $recipients IDs or usernames of message recipients. If this 28 * is an existing thread, it is unnecessary to pass a $recipients 29 * argument - existing thread recipients will be assumed. 30 * @type string $subject Optional. Subject line for the message. For 31 * existing threads, the existing subject will be used. For new 32 * threads, 'No Subject' will be used if no $subject is provided. 33 * @type string $content Content of the message. Cannot be empty. 34 * @type string $date_sent Date sent, in 'Y-m-d H:i:s' format. Default: 35 * current date/time. 23 * @type int $sender_id Optional. ID of the user who is sending the 24 * message. Default: ID of the logged-in user. 25 * @type int $thread_id Optional. ID of the parent thread. Leave blank to 26 * create a new thread for the message. 27 * @type array $recipients IDs or usernames of message recipients. If this 28 * is an existing thread, it is unnecessary to pass a $recipients 29 * argument - existing thread recipients will be assumed. 30 * @type string $subject Optional. Subject line for the message. For 31 * existing threads, the existing subject will be used. For new 32 * threads, 'No Subject' will be used if no $subject is provided. 33 * @type string $content Content of the message. Cannot be empty. 34 * @type string $date_sent Date sent, in 'Y-m-d H:i:s' format. Default: current date/time. 36 35 * } 37 36 * @return int|bool ID of the message thread on success, false on failure. … … 174 173 * @param string $subject Subject of the notice. 175 174 * @param string $message Content of the notice. 175 * 176 176 * @return bool True on success, false on failure. 177 177 */ … … 207 207 * 208 208 * @param int|array Thread ID or array of thread IDs. 209 * 209 210 * @return bool True on success, false on failure. 210 211 */ … … 258 259 * 259 260 * @param int $thread_id ID of the thread. 260 * @param int $user_id Optional. ID of the user. Default: ID of the logged-in261 * user.261 * @param int $user_id Optional. ID of the user. Default: ID of the logged-in user. 262 * 262 263 * @return int|null Message ID if the user has access, otherwise null. 263 264 */ … … 300 301 * 301 302 * @param string $recipients Comma-separated list of recipient usernames. 302 * @param string $subject Subject of the message.303 * @param string $content Content of the message.303 * @param string $subject Subject of the message. 304 * @param string $content Content of the message. 304 305 */ 305 306 function messages_add_callback_values( $recipients, $subject, $content ) { … … 323 324 * Get the unread messages count for a user. 324 325 * 325 * @param int $user_id Optional. ID of the user. Default: ID of the 326 * logged-in user.326 * @param int $user_id Optional. ID of the user. Default: ID of the logged-in user. 327 * 327 328 * @return int 328 329 */ … … 338 339 * Check whether a user is the sender of a message. 339 340 * 340 * @param int $user_id ID of the user.341 * @param int $user_id ID of the user. 341 342 * @param int $message_id ID of the message. 343 * 342 344 * @return int|null Returns the ID of the message if the user is the 343 * sender, otherwise null.345 * sender, otherwise null. 344 346 */ 345 347 function messages_is_user_sender( $user_id, $message_id ) { … … 351 353 * 352 354 * @param int $message_id ID of the message. 355 * 353 356 * @return int|null The ID of the sender if found, otherwise null. 354 357 */ … … 361 364 * 362 365 * @param int $thread_id ID of the thread. 366 * 363 367 * @return int|null The message thread ID on success, null on failure. 364 368 */ … … 393 397 * 394 398 * @see delete_metadata() for full documentation excluding $meta_type variable. 399 * 400 * @param int $message_id ID of the message to have meta deleted for. 401 * @param string|bool $meta_key Meta key to delete. Default false. 402 * @param string|bool $meta_value Meta value to delete. Default false. 403 * @param bool $delete_all Whether or not to delete all meta data. 404 * 405 * @return bool 395 406 */ 396 407 function bp_messages_delete_meta( $message_id, $meta_key = false, $meta_value = false, $delete_all = false ) { … … 429 440 * 430 441 * @see get_metadata() for full documentation excluding $meta_type variable. 442 * 443 * @param int $message_id ID of the message to retrieve meta for. 444 * @param string $meta_key Meta key to retrieve. Default empty string. 445 * @param bool $single Whether or not to fetch all or a single value. 446 * 447 * @return mixed 431 448 */ 432 449 function bp_messages_get_meta( $message_id, $meta_key = '', $single = true ) { … … 444 461 * 445 462 * @see update_metadata() for full documentation excluding $meta_type variable. 463 * 464 * @param int $message_id ID of the message to have meta deleted for. 465 * @param string|bool $meta_key Meta key to update. 466 * @param string|bool $meta_value Meta value to update. 467 * @param string $prev_value If specified, only update existing metadata entries with 468 * the specified value. Otherwise, update all entries. 469 * 470 * @return mixed 446 471 */ 447 472 function bp_messages_update_meta( $message_id, $meta_key, $meta_value, $prev_value = '' ) { … … 459 484 * 460 485 * @see add_metadata() for full documentation excluding $meta_type variable. 486 * 487 * @param int $message_id ID of the message to have meta deleted for. 488 * @param string|bool $meta_key Meta key to update. 489 * @param string|bool $meta_value Meta value to update. 490 * @param bool $unique Whether the specified metadata key should be 491 * unique for the object. If true, and the object 492 * already has a value for the specified metadata key, 493 * no change will be made. 494 * @return mixed 461 495 */ 462 496 function bp_messages_add_meta( $message_id, $meta_key, $meta_value, $unique = false ) {
Note: See TracChangeset
for help on using the changeset viewer.