Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/12/2015 04:39:07 AM (12 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-template.php

    r9846 r9862  
    22
    33/**
    4  * BuddyPress Messages Template Tags
     4 * BuddyPress Messages Template Tags.
    55 *
    66 * @package BuddyPress
    … …  
    7373
    7474        /**
    75          * The current "box" view ('notices', 'sentbox', 'inbox')
     75         * The current "box" view ('notices', 'sentbox', 'inbox').
    7676         *
    7777         * @access public
    … …  
    370370 * @global BP_Messages_Box_Template $messages_template
    371371 *
    372  * @param array $args {
     372 * @param array|string $args {
    373373 *     Array of arguments. All are optional.
    374  *     @type int $user_id ID of the user whose threads are being loaded.
    375  *           Default: ID of the logged-in user.
    376  *     @type string $box Current "box" view. If not provided here, the current
    377  *           view will be inferred from the URL.
    378  *     @type int $per_page Number of results to return per page. Default: 10.
    379  *     @type int $max Max results to return. Default: false.
     374 *     @type int    $user_id      ID of the user whose threads are being loaded.
     375 *                                Default: ID of the logged-in user.
     376 *     @type string $box          Current "box" view. If not provided here, the current
     377 *                                view will be inferred from the URL.
     378 *     @type int    $per_page    Number of results to return per page. Default: 10.
     379 *     @type int    $max          Max results to return. Default: false.
    380380 *     @type string $search_terms Terms to which to limit results. Default:
    381  *           the value of $_REQUEST['s'].
    382  *     @type string $page_arg URL argument used for the pagination param.
    383  *           Default: 'mpage'.
    384  *     @type array $meta_query Meta query arguments. Only applicable if $box is
    385  *           not 'notices'. See WP_Meta_Query more details.
     381 *                                the value of $_REQUEST['s'].
     382 *     @type string $page_arg     URL argument used for the pagination param.
     383 *                                Default: 'mpage'.
     384 *     @type array  $meta_query  Meta query arguments. Only applicable if $box is
     385 *                                not 'notices'. See WP_Meta_Query more details.
    386386 * }
    387387 * @return bool True if there are threads to display, otherwise false.
    … …  
    524524
    525525/**
    526  * Output the thread's last message content
     526 * Output the thread's last message content.
    527527 *
    528528 * When viewing your Inbox, the last message is the most recent message in
    … …  
    538538}
    539539        /**
    540          * Return the thread's last message content
     540         * Return the thread's last message content.
    541541         *
    542542         * When viewing your Inbox, the last message is the most recent message in
    … …  
    547547         *
    548548         * @since BuddyPress (2.0.0)
    549          * @return string The raw content of the last message in the thread
     549         * @return string The raw content of the last message in the thread.
    550550         */
    551551        function bp_get_message_thread_content() {
    … …  
    614614 *
    615615 * @param int $thread_id Optional. ID of the thread. Default: current thread
    616  *        being iterated on in the loop.
     616 *                       being iterated on in the loop.
    617617 */
    618618function bp_message_thread_view_link( $thread_id = 0 ) {
    … …  
    623623         *
    624624         * @param int $thread_id Optional. ID of the thread. Default: current
    625          *        thread being iterated on in the loop.
     625         *                       thread being iterated on in the loop.
    626626         * @return string
    627627         */
    … …  
    728728}
    729729        /**
    730          * Return the URL used for marking a single message thread as read
     730         * Return the URL used for marking a single message thread as read.
    731731         *
    732732         * @since BuddyPress (2.2.0)
    … …  
    849849 * @since BuddyPress (2.2.0)
    850850 *
    851  * @param int $thread_id Optional. ID of the thread. Defaults to current thread ID.
     851 * @param int|bool $thread_id Optional. ID of the thread. Defaults to current thread ID.
    852852 */
    853853function bp_message_thread_total_count( $thread_id = false ) {
    … …  
    859859         * @since BuddyPress (2.2.0)
    860860         *
    861          * @param int $thread_id Optional. ID of the thread. Defaults to
    862          *        current thread ID.
     861         * @param int|bool $thread_id Optional. ID of the thread.
     862         *                            Defaults to current thread ID.
     863         *
    863864         * @return int
    864865         */
    … …  
    892893 * @since BuddyPress (2.2.0)
    893894 *
    894  * @param int $thread_id Optional. ID of the thread. Default: current thread ID.
     895 * @param int|bool $thread_id Optional. ID of the thread. Default: current thread ID.
    895896 */
    896897function bp_message_thread_total_and_unread_count( $thread_id = false ) {
    … …  
    900901         * Get markup for the current thread's total and unread count.
    901902         *
    902          * @param int $thread_id Optional. ID of the thread. Default: current thread ID.
     903         * @param int|bool $thread_id Optional. ID of the thread. Default: current thread ID.
     904         *
    903905         * @return string Markup displaying the total and unread count for the thread.
    904906         */
    … …  
    970972 * @see bp_get_message_thread_avatar() for a description of arguments.
    971973 *
    972  * @param array $args See {@link bp_get_message_thread_avatar()}.
     974 * @param array|string $args See {@link bp_get_message_thread_avatar()}.
    973975 */
    974976function bp_message_thread_avatar( $args = '' ) {
    … …  
    981983         *      return values.
    982984         *
    983          * @param array $args {
     985         * @param array|string $args {
    984986         *     Arguments are listed here with an explanation of their defaults.
    985987         *     For more information about the arguments, see
    986988         *     {@link bp_core_fetch_avatar()}.
    987          *     @type string $type Default: 'thumb'.
    988          *     @type int|bool $width Default: false.
    989          *     @type int|bool $height Default: false.
    990          *     @type string $class Default: 'avatar'.
    991          *     @type string|bool $id Default: false.
    992          *     @type string $alt Default: 'Profile picture of [display name]'.
     989         *     @type string      $type  Default: 'thumb'.
     990         *     @type int|bool    $width Default: false.
     991         *     @type int|bool    $height Default: false.
     992         *     @type string      $class Default: 'avatar'.
     993         *     @type string|bool $id     Default: false.
     994         *     @type string      $alt    Default: 'Profile picture of [display name]'.
    993995         * }
    994          * @return User avatar string.
     996         * @return string User avatar string.
    995997         */
    996998        function bp_get_message_thread_avatar( $args = '' ) {
    … …  
    11451147         * Return the form action for Messages HTML forms.
    11461148         *
    1147          * @return string The form action
     1149         * @return string The form action.
    11481150         */
    11491151        function bp_get_messages_form_action() {
    … …  
    11541156                 * @since BuddyPress (1.0.0)
    11551157                 *
    1156                  * @param string The form action.
     1158                 * @param string $value The form action.
    11571159                 */
    11581160                return apply_filters( 'bp_get_messages_form_action', trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/' . bp_action_variable( 0 ) ) );
    … …  
    18281830         * Constructor method.
    18291831         *
    1830          * @see BP_Messages_Thread::populate() for full parameter info
     1832         * @see BP_Messages_Thread::populate() for full parameter info.
     1833         *
     1834         * @param int    $thread_id
     1835         * @param string $order
     1836         * @param array  $args
    18311837         */
    18321838        public function __construct( $thread_id = 0, $order = 'ASC', $args = array() ) {
    … …  
    19381944 * Initialize the messages template loop for a specific thread.
    19391945 *
    1940  * @param array $args {
     1946 * @param array|string $args {
    19411947 *     Array of arguments. All are optional.
    1942  *     @type int $thread_id ID of the thread whose messages you are displaying.
    1943  *           Default: if viewing a thread, the thread ID will be parsed from
    1944  *           the URL (bp_action_variable( 0 )).
    1945  *     @type string $order 'ASC' or 'DESC'. Default: 'ASC'.
    1946  *     @type bool $update_meta_cache Whether to pre-fetch metadata for
    1947  *           queried message items. Default: true.
     1948 *     @type int    $thread_id        ID of the thread whose messages you are displaying.
     1949 *                                     Default: if viewing a thread, the thread ID will be parsed from
     1950 *                                     the URL (bp_action_variable( 0 )).
     1951 *     @type string $order             'ASC' or 'DESC'. Default: 'ASC'.
     1952 *     @type bool   $update_meta_cache Whether to pre-fetch metadata for
     1953 *                                     queried message items. Default: true.
    19481954 * }
    19491955 * @return bool True if there are messages to display, otherwise false.
    … …  
    22542260
    22552261/**
    2256  * Output the ID for message sender within a single thread
     2262 * Output the ID for message sender within a single thread.
    22572263 *
    22582264 * @since BuddyPress (2.1.0)
    … …  
    22622268}
    22632269        /**
    2264          * Return the ID for message sender within a single thread
     2270         * Return the ID for message sender within a single thread.
    22652271         *
    22662272         * @since BuddyPress (2.1.0)
    … …  
    22882294 * Output the avatar for the current message sender.
    22892295 *
    2290  * @param array $args See {@link bp_get_the_thread_message_sender_avatar_thumb()}
    2291  *        for a description.
     2296 * @param array|string $args See {@link bp_get_the_thread_message_sender_avatar_thumb()}
     2297 *                           for a description.
    22922298 */
    22932299function bp_the_thread_message_sender_avatar( $args = '' ) {
    … …  
    22972303         * Get the avatar for the current message sender.
    22982304         *
    2299          * @param array $args {
     2305         * @param array|string $args {
    23002306         *     Array of arguments. See {@link bp_core_fetch_avatar()} for more
    23012307         *     complete details. All arguments are optional.
    2302          *     @type string $type Avatar type. Default: 'thumb'.
    2303          *     @type int $width Avatar width. Default: default for your $type.
    2304          *     @type int $height Avatar height. Default: default for your $type.
     2308         *     @type string $type   Avatar type. Default: 'thumb'.
     2309         *     @type int    $width Avatar width. Default: default for your $type.
     2310         *     @type int    $height Avatar height. Default: default for your $type.
    23052311         * }
    23062312         * @return string <img> tag containing the avatar.
    … …  
    24452451         * @since BuddyPress (2.1.0)
    24462452         *
    2447          * @uses strtotime() To convert the message string into a usable timestamp
     2453         * @uses strtotime() To convert the message string into a usable timestamp.
     2454         *
    24482455         * @return int
    24492456         */
    … …  
    25082515 * @since BuddyPress (2.2.0)
    25092516 *
    2510  * @param string $cache An empty string passed by BP_Embed::parse_oembed() for
    2511  *        functions like this one to filter.
    2512  * @param int $id The ID of the message item.
     2517 * @param string $cache    An empty string passed by BP_Embed::parse_oembed() for
     2518 *                         functions like this one to filter.
     2519 * @param int    $id      The ID of the message item.
    25132520 * @param string $cachekey The cache key generated in BP_Embed::parse_oembed().
     2521 *
    25142522 * @return mixed The cached embeds for this message item.
    25152523 */
    … …  
    25252533 * @since BuddyPress (2.2.0)
    25262534 *
    2527  * @param string $cache An empty string passed by BP_Embed::parse_oembed() for
    2528  *        functions like this one to filter.
     2535 * @param string $cache    An empty string passed by BP_Embed::parse_oembed() for
     2536 *                         functions like this one to filter.
    25292537 * @param string $cachekey The cache key generated in BP_Embed::parse_oembed().
    2530  * @param int $id The ID of the message item.
     2538 * @param int    $id       The ID of the message item.
     2539 *
    25312540 * @return bool True on success, false on failure.
    25322541 */
Note: See TracChangeset for help on using the changeset viewer.