Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/12/2015 04:39:07 AM (10 years ago)
Author:
tw2113
Message:

First pass at messages component docs cleanup.

See #6403.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/bp-messages-functions.php

    r9845 r9862  
    22
    33/**
    4  * BuddyPress Messages Functions
     4 * BuddyPress Messages Functions.
    55 *
    66 * Business functions are where all the magic happens in BuddyPress. They will
     
    1919 * Create a new message.
    2020 *
    21  * @param array $args {
     21 * @param array|string $args {
    2222 *     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.
    3635 * }
    3736 * @return int|bool ID of the message thread on success, false on failure.
     
    174173 * @param string $subject Subject of the notice.
    175174 * @param string $message Content of the notice.
     175 *
    176176 * @return bool True on success, false on failure.
    177177 */
     
    207207 *
    208208 * @param int|array Thread ID or array of thread IDs.
     209 *
    209210 * @return bool True on success, false on failure.
    210211 */
     
    258259 *
    259260 * @param int $thread_id ID of the thread.
    260  * @param int $user_id Optional. ID of the user. Default: ID of the logged-in
    261  *        user.
     261 * @param int $user_id   Optional. ID of the user. Default: ID of the logged-in user.
     262 *
    262263 * @return int|null Message ID if the user has access, otherwise null.
    263264 */
     
    300301 *
    301302 * @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.
    304305 */
    305306function messages_add_callback_values( $recipients, $subject, $content ) {
     
    323324 * Get the unread messages count for a user.
    324325 *
    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 *
    327328 * @return int
    328329 */
     
    338339 * Check whether a user is the sender of a message.
    339340 *
    340  * @param int $user_id ID of the user.
     341 * @param int $user_id    ID of the user.
    341342 * @param int $message_id ID of the message.
     343 *
    342344 * @return int|null Returns the ID of the message if the user is the
    343  *         sender, otherwise null.
     345 *                  sender, otherwise null.
    344346 */
    345347function messages_is_user_sender( $user_id, $message_id ) {
     
    351353 *
    352354 * @param int $message_id ID of the message.
     355 *
    353356 * @return int|null The ID of the sender if found, otherwise null.
    354357 */
     
    361364 *
    362365 * @param int $thread_id ID of the thread.
     366 *
    363367 * @return int|null The message thread ID on success, null on failure.
    364368 */
     
    393397 *
    394398 * @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
    395406 */
    396407function bp_messages_delete_meta( $message_id, $meta_key = false, $meta_value = false, $delete_all = false ) {
     
    429440 *
    430441 * @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
    431448 */
    432449function bp_messages_get_meta( $message_id, $meta_key = '', $single = true ) {
     
    444461 *
    445462 * @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
    446471 */
    447472function bp_messages_update_meta( $message_id, $meta_key, $meta_value, $prev_value = '' ) {
     
    459484 *
    460485 * @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
    461495 */
    462496function bp_messages_add_meta( $message_id, $meta_key, $meta_value, $unique = false ) {
Note: See TracChangeset for help on using the changeset viewer.