Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/03/2015 06:51:25 PM (10 years ago)
Author:
tw2113
Message:

First pass at cleanup of Activity component documetnation.

See #6396.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-template.php

    r9828 r9833  
    227227     *     'include'. Default values for 'per_page' and 'display_comments'
    228228     *     differ from the originating function, and are described below.
    229      *     @type string $page_arg The string used as a query parameter in
    230      *           pagination links. Default: 'acpage'.
    231      *     @type array|bool $include Pass an array of activity IDs to
    232      *           retrieve only those items, or false to noop the 'include'
    233      *           parameter. 'include' differs from 'in' in that 'in' forms
    234      *           an IN clause that works in conjunction with other filters
    235      *           passed to the function, while 'include' is interpreted as
    236      *           an exact list of items to retrieve, which skips all other
    237      *           filter-related parameters. Default: false.
    238      *     @type int|bool $per_page Default: 20.
     229     *     @type string      $page_arg        The string used as a query parameter in
     230     *                                         pagination links. Default: 'acpage'.
     231     *     @type array|bool  $include          Pass an array of activity IDs to
     232     *                                         retrieve only those items, or false to noop the 'include'
     233     *                                         parameter. 'include' differs from 'in' in that 'in' forms
     234     *                                         an IN clause that works in conjunction with other filters
     235     *                                         passed to the function, while 'include' is interpreted as
     236     *                                         an exact list of items to retrieve, which skips all other
     237     *                                         filter-related parameters. Default: false.
     238     *     @type int|bool    $per_page        Default: 20.
    239239     *     @type string|bool $display_comments Default: 'threaded'.
    240240     * }
     
    523523 * @uses apply_filters() To call the 'bp_has_activities' hook.
    524524 *
    525  * @param array $args {
     525 * @param array|string $args {
    526526 *     Arguments for limiting the contents of the activity loop. Most arguments
    527527 *     are in the same format as {@link BP_Activity_Activity::get()}. However,
     
    14221422 * @uses bp_get_activity_avatar()
    14231423 *
    1424  * @param array $args See {@link bp_get_activity_avatar()} for description.
     1424 * @param array|string $args See {@link bp_get_activity_avatar()} for description.
    14251425 */
    14261426function bp_activity_avatar( $args = '' ) {
     
    14411441     * @uses apply_filters() To call the 'bp_get_activity_avatar' hook
    14421442     *
    1443      * @param array $args  {
     1443     * @param array|string $args  {
    14441444     *     Arguments are listed here with an explanation of their defaults.
    14451445     *     For more information about the arguments, see
    14461446     *     {@link bp_core_fetch_avatar()}.
    1447      *     @type string $alt Default: 'Profile picture of [user name]' if
    1448      *           activity user name is available, otherwise 'Profile picture'.
    1449      *     @type string $class Default: 'avatar'.
    1450      *     @type string|bool $email Default: Email of the activity's
    1451      *           associated user, if available. Otherwise false.
    1452      *     @type string $type Default: 'full' when viewing a single activity
    1453      *           permalink page, otherwise 'thumb'.
    1454      *     @type int|bool $user_id Default: ID of the activity's user.
     1447     *     @type string      $alt    Default: 'Profile picture of [user name]' if
     1448     *                                activity user name is available, otherwise 'Profile picture'.
     1449     *     @type string      $class  Default: 'avatar'.
     1450     *     @type string|bool $email   Default: Email of the activity's
     1451     *                                associated user, if available. Otherwise false.
     1452     *     @type string      $type    Default: 'full' when viewing a single activity
     1453     *                                permalink page, otherwise 'thumb'.
     1454     *     @type int|bool    $user_id Default: ID of the activity's user.
    14551455     * }
    14561456     * @return string User avatar string.
     
    15571557 * @uses bp_get_activity_secondary_avatar()
    15581558 *
    1559  * @param array $args See {@link bp_get_activity_secondary_avatar} for description.
     1559 * @param array|string $args See {@link bp_get_activity_secondary_avatar} for description.
    15601560 */
    15611561function bp_activity_secondary_avatar( $args = '' ) {
     
    15791579     * @param array $args  {
    15801580     *     For a complete description of arguments, see {@link bp_core_fetch_avatar()}.
    1581      *     @type string $alt Default value varies based on current activity
    1582      *           item component.
    1583      *     @type string $type Default: 'full' when viewing a single activity
    1584      *           permalink page, otherwise 'thumb'.
    1585      *     @type string $class Default: 'avatar'.
    1586      *     @type string|bool $email Default: email of the activity's user.
    1587      *     @type int|bool $user_id Default: ID of the activity's user.
     1581     *     @type string      $alt    Default value varies based on current activity
     1582     *                                item component.
     1583     *     @type string      $type    Default: 'full' when viewing a single activity
     1584     *                                permalink page, otherwise 'thumb'.
     1585     *     @type string      $class  Default: 'avatar'.
     1586     *     @type string|bool $email   Default: email of the activity's user.
     1587     *     @type int|bool    $user_id Default: ID of the activity's user.
    15881588     * }
    15891589     * @return string The secondary avatar
     
    17151715             * @since BuddyPress (1.7.0)
    17161716             *
    1717              * @param string $link Link to wrap the avatar image in.
     1717             * @param string $link      Link to wrap the avatar image in.
    17181718             * @param string $component Activity component being acted on.
    17191719             */
     
    17251725             * @since BuddyPress (1.2.10)
    17261726             *
    1727              * @param string Formatted HTML <img> element, or raw avatar URL.
     1727             * @param string $avatar Formatted HTML <img> element, or raw avatar URL.
    17281728             */
    17291729            $avatar = apply_filters( 'bp_get_activity_secondary_avatar', $avatar );
     
    17661766     *     @type bool $no_timestamp Whether to exclude the timestamp.
    17671767     * }
     1768     *
    17681769     * @return string The activity action.
    17691770     */
     
    19241925 *
    19251926 * @param string $content The activity content.
     1927 *
    19261928 * @return string The activity content with the metadata string attached.
    19271929 */
     
    19921994 * @uses apply_filters() To call the 'bp_activity_user_can_delete' hook
    19931995 *
    1994  * @param object $activity Optional. Falls back on the current item in the loop.
     1996 * @param object|bool $activity Optional. Falls back on the current item in the loop.
     1997 *
    19951998 * @return bool True if can delete, false otherwise.
    19961999 */
     
    20382041     *
    20392042     * @param bool   $can_delete Whether the user can delete the item.
    2040      * @param object $activity Current activity item object.
     2043     * @param object $activity   Current activity item object.
    20412044     */
    20422045    return (bool) apply_filters( 'bp_activity_user_can_delete', $can_delete, $activity );
     
    20512054 * @uses bp_get_activity_parent_content()
    20522055 *
    2053  * @param array $args See {@link bp_get_activity_parent_content} for description.
     2056 * @param array|string $args See {@link bp_get_activity_parent_content} for description.
    20542057 */
    20552058function bp_activity_parent_content( $args = '' ) {
     
    21312134     *
    21322135     * @return bool|int False if parent activity can't be found, otherwise
    2133      *         the parent activity's user ID.
     2136     *                  the parent activity's user ID.
    21342137     */
    21352138    function bp_get_activity_parent_user_id() {
     
    22072210 * @todo deprecate $args param
    22082211 *
    2209  * @param array $args See {@link bp_activity_get_comments} for description.
     2212 * @param array|string $args See {@link bp_activity_get_comments} for description.
    22102213 */
    22112214function bp_activity_comments( $args = '' ) {
     
    22272230     * @global object $activities_template {@link BP_Activity_Template}
    22282231     * @uses bp_activity_recurse_comments()
     2232     *
     2233     * @return bool
    22292234     */
    22302235    function bp_activity_get_comments( $args = '' ) {
     
    22502255         * @global object $activities_template {@link BP_Activity_Template}
    22512256         * @uses locate_template()
     2257         *
     2258         * @return bool|string
    22522259         */
    22532260        function bp_activity_recurse_comments( $comment ) {
     
    23092316 *
    23102317 * @return object|bool $current_comment The activity comment currently being
    2311  *         displayed. False on failure.
     2318 *                                      displayed. False on failure.
    23122319 */
    23132320function bp_activity_current_comment() {
     
    23482355     * @uses apply_filters() To call the 'bp_activity_comment_id' hook.
    23492356     *
    2350      * @return int|bool $comment_id The ID of the activity comment
    2351      *         currently being displayed, false if none is found.
     2357     * @return int|bool $comment_id The ID of the activity comment currently
     2358     *                             being displayed, false if none is found.
    23522359     */
    23532360    function bp_get_activity_comment_id() {
     
    23862393     *
    23872394     * @return int|bool $user_id The user_id of the author of the displayed
    2388      *         activity comment. False on failure.
     2395     *                           activity comment. False on failure.
    23892396     */
    23902397    function bp_get_activity_comment_user_id() {
     
    25032510     *
    25042511     * @return string|bool $date_recorded Time since the activity was recorded,
    2505      *         in the form "%s ago". False on failure.
     2512     *                                    in the form "%s ago". False on failure.
    25062513     */
    25072514    function bp_get_activity_comment_date_recorded() {
     
    25762583     *
    25772584     * @return string $link The nonced URL for deleting the current
    2578      *         activity comment.
     2585     *                      activity comment.
    25792586     */
    25802587    function bp_get_activity_comment_delete_link() {
     
    26932700         *
    26942701         * @param object $comment Activity comment object.
    2695          * @param int $count The current iteration count.
     2702         * @param int    $count The current iteration count.
    26962703         *
    26972704         * @return int $count The activity comment count.
     
    27162723             *
    27172724             * @param int    $new_count New total count for the current comment.
    2718              * @param object $comment Activity comment object.
    2719              * @param int    $count Current iteration count for the current comment.
     2725             * @param object $comment   Activity comment object.
     2726             * @param int    $count     Current iteration count for the current comment.
    27202727             */
    27212728            return apply_filters( 'bp_activity_recurse_comment_count', $new_count, $comment, $count );
     
    28032810     *
    28042811     * @return string|bool The activity comment form no JavaScript
    2805      *         display CSS. False on failure.
     2812     *                     display CSS. False on failure.
    28062813     */
    28072814    function bp_get_activity_comment_form_nojs_display() {
     
    29582965         * @since BuddyPress (1.8.0)
    29592966         *
    2960          * @param string $link Activity comment permalink.
     2967         * @param string $link       Activity comment permalink.
    29612968         * @param int    $comment_id ID for the current activity comment.
    29622969         */
     
    31273134     *
    31283135     * @return string $link Activity delete link. Contains $redirect_to arg
    3129      *         if on single activity page.
     3136     *                      if on single activity page.
    31303137     */
    31313138    function bp_get_activity_delete_link() {
     
    31773184     *
    31783185     * @return string $link Activity delete link. Contains $redirect_to arg
    3179      *         if on single activity page.
     3186     *                      if on single activity page.
    31803187     */
    31813188    function bp_get_activity_delete_url() {
     
    32303237     *
    32313238     * @param int $user_id If empty, will fall back on displayed user.
     3239     *
    32323240     * @return string|bool $latest_update The activity latest update link.
    3233      *         False on failure
     3241     *                                    False on failure
    32343242     */
    32353243    function bp_get_activity_latest_update( $user_id = 0 ) {
     
    32813289 * @uses bp_get_activity_filter_links()
    32823290 *
    3283  * @param array $args See {@link bp_get_activity_filter_links()} for description.
     3291 * @param array|bool $args See {@link bp_get_activity_filter_links()} for description.
    32843292 */
    32853293function bp_activity_filter_links( $args = false ) {
     
    33003308     * @uses apply_filters() To call the 'bp_get_activity_filter_links' hook.
    33013309     *
    3302      * @param array $args {
     3310     * @param array|bool $args {
    33033311     *     @type string $style The type of markup to use for the links.
    3304      *           'list', 'paragraph', or 'span'. Default: 'list'.
     3312     *                         'list', 'paragraph', or 'span'. Default: 'list'.
    33053313     * }
    33063314     * @return string|bool $component_links The activity filter links.
     
    33643372             * @since BuddyPress (1.1.0)
    33653373             *
    3366              * @param string $link The URL for the current component.
     3374             * @param string $link      The URL for the current component.
    33673375             * @param string $component The current component getting links constructed for.
    33683376             */
     
    34413449     * @since BuddyPress (1.5.0)
    34423450     *
    3443      * @param bool   $can_comment Status on if activity can be commented on.
     3451     * @param bool   $can_comment     Status on if activity can be commented on.
    34443452     * @param string $activity_action Current activity action being checked on.
    34453453     */
     
    34893497     *
    34903498     * @param bool   $can_comment Status on if activity reply can be commented on.
    3491      * @param string $comment Current comment being checked on.
     3499     * @param string $comment     Current comment being checked on.
    34923500     */
    34933501    return (bool) apply_filters( 'bp_activity_can_comment_reply', $can_comment, $comment );
     
    35403548     *
    35413549     * @param int $user_id ID of user being queried. Default: displayed user ID.
     3550     *
    35423551     * @return int The total favorite count for the specified user.
    35433552     */
     
    35913600     *
    35923601     * @param int $user_id ID of user being queried. Default: displayed user ID.
     3602     *
    35933603     * @return int The total mention count for the specified user.
    35943604     */
     
    36683678 * @param array $activity Array of activities generated from {@link bp_activity_get()}.
    36693679 * @param array $activity_ids Used for recursion purposes in this function.
     3680 *
    36703681 * @return array
    36713682 */
     
    36963707 * @uses bp_get_mentioned_user_display_name()
    36973708 *
    3698  * @param int|string $user_id_or_username See {@link bp_get_mentioned_user_display_name()}.
     3709 * @param int|string|bool $user_id_or_username See {@link bp_get_mentioned_user_display_name()}.
    36993710 */
    37003711function bp_mentioned_user_display_name( $user_id_or_username = false ) {
     
    37103721     * @uses apply_filters() To call the 'bp_get_mentioned_user_display_name' hook.
    37113722     *
    3712      * @param int|string User ID or username.
     3723     * @param int|string|bool User ID or username.
     3724     *
    37133725     * @return string The mentioned user's display name.
    37143726     */
     
    37283740         * @since BuddyPress (1.2.0)
    37293741         *
    3730          * @param string     $name Display name for the mentioned user.
     3742         * @param string     $name                Display name for the mentioned user.
    37313743         * @param int|string $user_id_or_username User ID or username use for query.
    37323744         */
     
    37423754 * @uses bp_get_send_public_message_button()
    37433755 *
    3744  * @param array $args See {@link bp_get_send_public_message_button()}.
     3756 * @param array|string $args See {@link bp_get_send_public_message_button()}.
    37453757 */
    37463758function bp_send_public_message_button( $args = '' ) {
     
    37583770     * @uses apply_filters() To call the 'bp_get_send_public_message_button' hook.
    37593771     *
    3760      * @param array $args {
     3772     * @param array|string $args {
    37613773     *     All arguments are optional. See {@link BP_Button} for complete
    37623774     *     descriptions.
    3763      *     @type string $id Default: 'public_message'.
    3764      *     @type string $component Default: 'activity'.
    3765      *     @type bool $must_be_logged_in Default: true.
    3766      *     @type bool $block_self Default: true.
    3767      *     @type string $wrapper_id Default: 'post-mention'.
    3768      *     @type string $link_href Default: the public message link for
    3769      *           the current member in the loop.
    3770      *     @type string $link_title Default: 'Send a public message on your
    3771      *           activity stream.'.
    3772      *     @type string $link_text Default: 'Public Message'.
    3773      *     @type string $link_class Default: 'activity-button mention'.
     3775     *     @type string $id                Default: 'public_message'.
     3776     *     @type string $component         Default: 'activity'.
     3777     *     @type bool   $must_be_logged_in Default: true.
     3778     *     @type bool   $block_self        Default: true.
     3779     *     @type string $wrapper_id        Default: 'post-mention'.
     3780     *     @type string $link_href         Default: the public message link for
     3781     *                                     the current member in the loop.
     3782     *     @type string $link_title        Default: 'Send a public message on your
     3783     *                                     activity stream.'.
     3784     *     @type string $link_text         Default: 'Public Message'.
     3785     *     @type string $link_class        Default: 'activity-button mention'.
    37743786     * }
    37753787     * @return string The button for sending a public message.
     
    38993911     *
    39003912     * @param string $retval HTML markup for the list of avatars.
    3901      * @param array  $r Array of arguments used for each avatar.
     3913     * @param array  $r      Array of arguments used for each avatar.
    39023914     * @param array  $output Array of each avatar found, before imploded into single string.
    39033915     */
     
    39353947     *
    39363948     * @param array $comments Array of {@link BP_Activity_Activity} items.
     3949     *
    39373950     * @return array Array of user IDs.
    39383951     */
     
    40054018 * @since BuddyPress (1.7.0)
    40064019 *
    4007  * @param string $output Optional. Either 'select' or 'checkbox'. Default: 'select'.
    4008  * @param array $args {
     4020 * @param string       $output Optional. Either 'select' or 'checkbox'. Default: 'select'.
     4021 * @param array|string $args {
    40094022 *     Optional extra arguments.
    4010  *     @type string $checkbox_name When returning checkboxes, sets the 'name'
    4011  *           attribute.
    4012  *     @type array|string $selected A list of types that should be checked/
    4013  *           selected.
     4023 *     @type string       $checkbox_name When returning checkboxes, sets the 'name'
     4024 *                                       attribute.
     4025 *     @type array|string $selected      A list of types that should be checked/
     4026 *                                       selected.
    40144027 * }
    40154028 */
     
    40494062         * @since BuddyPress (1.7.0)
    40504063         *
    4051          * @param array  $args Array of arguments passed into function.
    4052          * @param string $type Activity type being rendered in the output.
     4064         * @param array  $args        Array of arguments passed into function.
     4065         * @param string $type        Activity type being rendered in the output.
    40534066         * @param string $description Description of the activity type being rendered.
    40544067         */
     
    44254438 *
    44264439 * @param string $context The current context. 'activity', 'member',
    4427  *    'member_groups', 'group'.
     4440 *                        'member_groups', 'group'.
    44284441 * @uses bp_get_activity_show_filters()
    44294442 */
     
    44374450     *
    44384451     * @param string $context The current context. 'activity', 'member',
    4439      *    'member_groups', 'group'
     4452     *                        'member_groups', 'group'
     4453     *
    44404454     * @return string HTML for <option> values.
    44414455     */
     
    44874501         * @since BuddyPress (2.2.0)
    44884502         *
    4489          * @param array $filters Array of filter options for the given context, in the following format: $option_value => $option_name.
     4503         * @param array  $filters Array of filter options for the given context, in the following format: $option_value => $option_name.
    44904504         * @param string $context Context for the filter. 'activity', 'member', 'member_groups', 'group'.
    44914505         */
     
    45064520         * @since BuddyPress (2.1.0)
    45074521         *
    4508          * @param string $output HTML output for the activity filter dropdown.
     4522         * @param string $output  HTML output for the activity filter dropdown.
    45094523         * @param array  $filters Array of filter options for the given context, in the following format: $option_value => $option_name.
    45104524         * @param string $context Context for the filter. 'activity', 'member', 'member_groups', 'group'.
Note: See TracChangeset for help on using the changeset viewer.