Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/06/2011 12:30:01 PM (14 years ago)
Author:
boonebgorges
Message:

Adds PHPDoc throughout the activity component. References #2345. Turbo props cnorris23

File:
1 edited

Legend:

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

    r5019 r5109  
    11<?php
     2
    23/**
    34 * BuddyPress Activity Template Functions
    45 *
    56 * @package BuddyPress
    6  * @subpackage Activity Template
     7 * @subpackage ActivityTemplate
    78 */
    89
     
    1314 * Output the activity component slug
    1415 *
    15  * @package BuddyPress
    16  * @subpackage Activity Template
    17  * @since 1.5
     16 * @since 1.5.0
    1817 *
    1918 * @uses bp_get_activity_slug()
     
    2524     * Return the activity component slug
    2625     *
    27      * @package BuddyPress
    28      * @subpackage Activity Template
    29      * @since 1.5
     26     * @since 1.5.0
     27     *
     28     * @global object $bp BuddyPress global settings
     29     * @uses apply_filters() To call the 'bp_get_activity_slug' hook
    3030     */
    3131    function bp_get_activity_slug() {
     
    3737 * Output the activity component root slug
    3838 *
    39  * @package BuddyPress
    40  * @subpackage Activity Template
    41  * @since 1.5
     39 * @since 1.5.0
    4240 *
    4341 * @uses bp_get_activity_root_slug()
     
    4947     * Return the activity component root slug
    5048     *
    51      * @package BuddyPress
    52      * @subpackage Activity Template
    53      * @since 1.5
     49     * @since 1.5.0
     50     *
     51     * @global object $bp BuddyPress global settings
     52     * @uses apply_filters() To call the 'bp_get_activity_root_slug' hook
    5453     */
    5554    function bp_get_activity_root_slug() {
     
    6160 * Output member directory permalink
    6261 *
    63  * @package BuddyPress
    64  * @subpackage Activity Template
    65  * @since 1.5
     62 * @since 1.5.0
     63 *
    6664 * @uses bp_get_activity_directory_permalink()
    6765 */
     
    7270     * Return member directory permalink
    7371     *
    74      * @package BuddyPress
    75      * @subpackage Activity Template
    76      * @since 1.5
    77      * @uses apply_filters()
     72     * @since 1.5.0
     73     *
    7874     * @uses traisingslashit()
    7975     * @uses bp_get_root_domain()
    8076     * @uses bp_get_activity_root_slug()
    81      * @return string
     77     * @uses apply_filters() To call the 'bp_get_activity_directory_permalink' hook
     78     *
     79     * @return string Activity directory permalink
    8280     */
    8381    function bp_get_activity_directory_permalink() {
     
    9088 * This is responsible for loading a group of activity items and displaying them
    9189 *
    92  * @package BuddyPress
    93  * @subpackage Activity Template
    94  * @since 1.5
     90 * @since 1.0.0
    9591 */
    9692class BP_Activity_Template {
     
    231227
    232228/**
    233  * bp_has_activities()
    234  *
    235229 * Initializes the activity loop.
    236230 *
    237231 * Based on the $args passed, bp_has_activities() populates the $activities_template global.
    238232 *
    239  * @global BP_Activity_Template $activities_template
    240  * @global object $bp Global BuddyPress settings object
    241  * @param mixed $args Arguments for limiting the contents of the activity loop. Can be passed as an associative array or as a URL argument string
     233 * @since 1.0.0
     234 *
     235 * @param array $args Arguments for limiting the contents of the activity loop. Can be passed as an associative array or as a URL argument string
     236 *
     237 * @global object $activities_template {@link BP_Activity_Template}
     238 * @global object $bp BuddyPress global settings
     239 * @uses groups_is_user_member()
     240 * @uses bp_current_action()
     241 * @uses bp_is_current_action()
     242 * @uses bp_get_activity_slug()
     243 * @uses bp_action_variable()
     244 * @uses wp_parse_args()
     245 * @uses bp_is_active()
     246 * @uses friends_get_friend_user_ids()
     247 * @uses groups_get_user_groups()
     248 * @uses bp_activity_get_user_favorites()
     249 * @uses apply_filters() To call the 'bp_has_activities' hook
     250 *
    242251 * @return bool Returns true when activities are found
    243252 */
     
    381390}
    382391
     392/**
     393 * Determines if there are still activities left in the loop.
     394 *
     395 * @since 1.0.0
     396 *
     397 * @global object $activities_template {@link BP_Activity_Template}
     398 * @uses BP_Activity_Template::user_activities() {@link BP_Activity_Template::user_activities()}
     399 *
     400 * @return bool Returns true when activities are found
     401 */
    383402function bp_activities() {
    384403    global $activities_template;
     
    386405}
    387406
     407/**
     408 * Gets the current activity object in the loop
     409 *
     410 * @since 1.0.0
     411 *
     412 * @global object $activities_template {@link BP_Activity_Template}
     413 * @uses BP_Activity_Template::the_activity() {@link BP_Activity_Template::the_activity()}
     414 *
     415 * @return object The current activity within the loop
     416 */
    388417function bp_the_activity() {
    389418    global $activities_template;
     
    391420}
    392421
     422/**
     423 * Outputs the activity pagination count
     424 *
     425 * @since 1.0.0
     426 *
     427 * @global object $activities_template {@link BP_Activity_Template}
     428 * @uses BP_Activity_Template::the_activity() {@link BP_Activity_Template::the_activity()}
     429 */
    393430function bp_activity_pagination_count() {
    394431    echo bp_get_activity_pagination_count();
    395432}
     433
     434    /**
     435     * Returns the activity pagination count
     436     *
     437     * @since 1.2.0
     438     *
     439     * @global object $bp BuddyPress global settings
     440     * @global object $activities_template {@link BP_Activity_Template}
     441     * @uses bp_core_number_format()
     442     *
     443     * @return string The pagination text
     444     */
    396445    function bp_get_activity_pagination_count() {
    397446        global $bp, $activities_template;
     
    405454    }
    406455
     456/**
     457 * Outputs the activity pagination links
     458 *
     459 * @since 1.0.0
     460 *
     461 * @uses bp_get_activity_pagination_links()
     462 */
    407463function bp_activity_pagination_links() {
    408464    echo bp_get_activity_pagination_links();
    409465}
     466
     467    /**
     468     * Outputs the activity pagination links
     469     *
     470     * @since 1.0.0
     471     *
     472     * @global object $activities_template {@link BP_Activity_Template}
     473     * @uses apply_filters() To call the 'bp_get_activity_pagination_links' hook
     474     *
     475     * @return string The pagination links
     476     */
    410477    function bp_get_activity_pagination_links() {
    411478        global $activities_template;
     
    417484 * Returns true when there are more activity items to be shown than currently appear
    418485 *
    419  * @package BuddyPress Activity
    420  * @since 1.5
    421  *
    422  * @global $activities_template The activity data loop object created in bp_has_activities()
     486 * @since 1.5.0
     487 *
     488 * @global object $activities_template {@link BP_Activity_Template}
     489 * @uses apply_filters() To call the 'bp_activity_has_more_items' hook
     490 *
     491 * @return bool $has_more_items True if more items, false if not
    423492 */
    424493function bp_activity_has_more_items() {
     
    431500}
    432501
     502/**
     503 * Outputs the activity count
     504 *
     505 * @since 1.2.0
     506 *
     507 * @uses bp_get_activity_count()
     508 */
    433509function bp_activity_count() {
    434510    echo bp_get_activity_count();
    435511}
     512
     513    /**
     514     * Returns the activity count
     515     *
     516     * @since 1.2.0
     517     *
     518     * @global object $activities_template {@link BP_Activity_Template}
     519     * @uses apply_filters() To call the 'bp_get_activity_count' hook
     520     *
     521     * @return int The activity count
     522     */
    436523    function bp_get_activity_count() {
    437524        global $activities_template;
     
    440527    }
    441528
     529/**
     530 * Outputs the number of activities per page
     531 *
     532 * @since 1.2.0
     533 *
     534 * @uses bp_get_activity_per_page()
     535 */
    442536function bp_activity_per_page() {
    443537    echo bp_get_activity_per_page();
    444538}
     539
     540    /**
     541     * Returns the number of activities per page
     542     *
     543     * @since 1.2.0
     544     *
     545     * @global object $activities_template {@link BP_Activity_Template}
     546     * @uses apply_filters() To call the 'bp_get_activity_per_page' hook
     547     *
     548     * @return int The activities per page
     549     */
    445550    function bp_get_activity_per_page() {
    446551        global $activities_template;
     
    449554    }
    450555
     556/**
     557 * Outputs the activities title
     558 *
     559 * @since 1.0.0
     560 *
     561 * @uses bp_get_activities_title()
     562 */
    451563function bp_activities_title() {
    452564    global $bp_activity_title;
     
    454566    echo bp_get_activities_title();
    455567}
     568
     569    /**
     570     * Returns the activities title
     571     *
     572     * @since 1.0.0
     573     *
     574     * @global string $bp_activity_title
     575     * @uses apply_filters() To call the 'bp_get_activities_title' hook
     576     *
     577     * @return int The activities title
     578     */
    456579    function bp_get_activities_title() {
    457580        global $bp_activity_title;
     
    460583    }
    461584
     585/**
     586 * {@internal Missing Description}
     587 *
     588 * @since 1.0.0
     589 *
     590 * @uses bp_get_activities_no_activity()
     591 */
    462592function bp_activities_no_activity() {
    463593    global $bp_activity_no_activity;
     
    465595    echo bp_get_activities_no_activity();
    466596}
     597
     598    /**
     599     * {@internal Missing Description}
     600     *
     601     * @since 1.0.0
     602     *
     603     * @global string $bp_activity_no_activity
     604     * @uses apply_filters() To call the 'bp_get_activities_no_activity' hook
     605     *
     606     * @return unknown_type
     607     */
    467608    function bp_get_activities_no_activity() {
    468609        global $bp_activity_no_activity;
     
    471612    }
    472613
     614/**
     615 * Outputs the activity id
     616 *
     617 * @since 1.2.0
     618 *
     619 * @uses bp_get_activity_id()
     620 */
    473621function bp_activity_id() {
    474622    echo bp_get_activity_id();
    475623}
     624
     625    /**
     626     * Returns the activity id
     627     *
     628     * @since 1.2.0
     629     *
     630     * @global object $activities_template {@link BP_Activity_Template}
     631     * @uses apply_filters() To call the 'bp_get_activity_id' hook
     632     *
     633     * @return int The activity id
     634     */
    476635    function bp_get_activity_id() {
    477636        global $activities_template;
     
    479638    }
    480639
     640/**
     641 * Outputs the activity item id
     642 *
     643 * @since 1.2.0
     644 *
     645 * @uses bp_get_activity_item_id()
     646 */
    481647function bp_activity_item_id() {
    482648    echo bp_get_activity_item_id();
    483649}
     650
     651    /**
     652     * Returns the activity item id
     653     *
     654     * @since 1.2.0
     655     *
     656     * @global object $activities_template {@link BP_Activity_Template}
     657     * @uses apply_filters() To call the 'bp_get_activity_item_id' hook
     658     *
     659     * @return int The activity item id
     660     */
    484661    function bp_get_activity_item_id() {
    485662        global $activities_template;
     
    487664    }
    488665
     666/**
     667 * Outputs the activity secondary item id
     668 *
     669 * @since 1.2.0
     670 *
     671 * @uses bp_get_activity_secondary_item_id()
     672 */
    489673function bp_activity_secondary_item_id() {
    490674    echo bp_get_activity_secondary_item_id();
    491675}
     676
     677    /**
     678     * Returns the activity secondary item id
     679     *
     680     * @since 1.2.0
     681     *
     682     * @global object $activities_template {@link BP_Activity_Template}
     683     * @uses apply_filters() To call the 'bp_get_activity_secondary_item_id' hook
     684     *
     685     * @return int The activity secondary item id
     686     */
    492687    function bp_get_activity_secondary_item_id() {
    493688        global $activities_template;
     
    495690    }
    496691
     692/**
     693 * Outputs the date the activity was recorded
     694 *
     695 * @since 1.2.0
     696 *
     697 * @uses bp_get_activity_date_recorded()
     698 */
    497699function bp_activity_date_recorded() {
    498700    echo bp_get_activity_date_recorded();
    499701}
     702
     703    /**
     704     * Returns the date the activity was recorded
     705     *
     706     * @since 1.2.0
     707     *
     708     * @global object $activities_template {@link BP_Activity_Template}
     709     * @uses apply_filters() To call the 'bp_get_activity_date_recorded' hook
     710     *
     711     * @return string The date the activity was recorded
     712     */
    500713    function bp_get_activity_date_recorded() {
    501714        global $activities_template;
     
    503716    }
    504717
     718/**
     719 * Outputs the activity object name
     720 *
     721 * @since 1.2.0
     722 *
     723 * @uses bp_get_activity_object_name()
     724 */
    505725function bp_activity_object_name() {
    506726    echo bp_get_activity_object_name();
    507727}
     728
     729    /**
     730     * Returns the activity object name
     731     *
     732     * @since 1.2.0
     733     *
     734     * @global object $activities_template {@link BP_Activity_Template}
     735     * @uses apply_filters() To call the 'bp_get_activity_object_name' hook
     736     *
     737     * @return string The activity object name
     738     */
    508739    function bp_get_activity_object_name() {
    509740        global $activities_template;
     
    511742    }
    512743
     744/**
     745 * Outputs the activity type
     746 *
     747 * @since 1.2.0
     748 *
     749 * @uses bp_get_activity_type()
     750 */
    513751function bp_activity_type() {
    514752    echo bp_get_activity_type();
    515753}
     754
     755    /**
     756     * Returns the activity type
     757     *
     758     * @since 1.2.0
     759     *
     760     * @global object $activities_template {@link BP_Activity_Template}
     761     * @uses apply_filters() To call the 'bp_get_activity_type' hook
     762     *
     763     * @return string The activity type
     764     */
    516765    function bp_get_activity_type() {
    517766        global $activities_template;
    518767        return apply_filters( 'bp_get_activity_type', $activities_template->activity->type );
    519768    }
     769
     770    /**
     771     * Outputs the activity action name
     772     *
     773     * Just a wrapper for bp_activity_type()
     774     *
     775     * @since 1.2.0
     776     * @deprecated 1.5.0
     777     *
     778     * @todo Properly deprecate in favor of bp_activity_type() and
     779     *       remove redundant echo
     780     *
     781     * @uses bp_activity_type()
     782     */
    520783    function bp_activity_action_name() { echo bp_activity_type(); }
     784
     785    /**
     786     * Returns the activity type
     787     *
     788     * Just a wrapper for bp_get_activity_type()
     789     *
     790     * @since 1.2.0
     791     * @deprecated 1.5.0
     792     *
     793     * @todo Properly deprecate in favor of bp_get_activity_type()
     794     *
     795     * @uses bp_get_activity_type()
     796     *
     797     * @return string The activity type
     798     */
    521799    function bp_get_activity_action_name() { return bp_get_activity_type(); }
    522800
     801/**
     802 * Outputs the activity user id
     803 *
     804 * @since 1.1.0
     805 *
     806 * @uses bp_get_activity_user_id()
     807 */
    523808function bp_activity_user_id() {
    524809    echo bp_get_activity_user_id();
    525810}
     811
     812    /**
     813     * Returns the activity user id
     814     *
     815     * @since 1.1.0
     816     *
     817     * @global object $activities_template {@link BP_Activity_Template}
     818     * @uses apply_filters() To call the 'bp_get_activity_user_id' hook
     819     *
     820     * @return int The activity user id
     821     */
    526822    function bp_get_activity_user_id() {
    527823        global $activities_template;
     
    529825    }
    530826
     827/**
     828 * Outputs the activity user link
     829 *
     830 * @since 1.2.0
     831 *
     832 * @uses bp_get_activity_user_link()
     833 */
    531834function bp_activity_user_link() {
    532835    echo bp_get_activity_user_link();
    533836}
     837
     838    /**
     839     * Returns the activity user link
     840     *
     841     * @since 1.2.0
     842     *
     843     * @global object $activities_template {@link BP_Activity_Template}
     844     * @uses bp_core_get_user_domain()
     845     * @uses apply_filters() To call the 'bp_get_activity_user_link' hook
     846     *
     847     * @return string $link The activity user link
     848     */
    534849    function bp_get_activity_user_link() {
    535850        global $activities_template;
     
    544859
    545860/**
    546  * bp_activity_avatar( $args )
    547  *
    548861 * Output the avatar of the user that performed the action
    549862 *
     863 * @since 1.1.0
     864 *
    550865 * @param array $args
     866 *
     867 * @uses bp_get_activity_avatar()
    551868 */
    552869function bp_activity_avatar( $args = '' ) {
     
    554871}
    555872    /**
    556      * bp_get_activity_avatar( $args )
    557      *
    558873     * Return the avatar of the user that performed the action
    559874     *
    560      * @global array $bp
    561      * @global object $activities_template
     875     * @since 1.1.0
     876     *
    562877     * @param array $args optional
    563      * @return string
     878     *
     879     * @global object $activities_template {@link BP_Activity_Template}
     880     * @global object $bp BuddyPress global settings
     881     * @uses bp_is_single_activity()
     882     * @uses wp_parse_args()
     883     * @uses apply_filters() To call the 'bp_get_activity_avatar_object_' . $current_activity_item->component hook
     884     * @uses apply_filters() To call the 'bp_get_activity_avatar_item_id' hook
     885     * @uses bp_core_fetch_avatar()
     886     * @uses apply_filters() To call the 'bp_get_activity_avatar' hook
     887     *
     888     * @return string User avatar
    564889     */
    565890    function bp_get_activity_avatar( $args = '' ) {
     
    614939
    615940/**
    616  * bp_activity_secondary_avatar( $args )
    617  *
    618941 * Output the avatar of the object that action was performed on
    619942 *
     943 * @since 1.2.0
     944 *
    620945 * @param array $args optional
     946 *
     947 * @uses bp_get_activity_secondary_avatar()
    621948 */
    622949function bp_activity_secondary_avatar( $args = '' ) {
    623950    echo bp_get_activity_secondary_avatar( $args );
    624951}
    625     /**
    626      * bp_get_activity_secondary_avatar( $args )
    627      *
     952
     953    /**
    628954     * Return the avatar of the object that action was performed on
    629955     *
    630      * @global array $bp
    631      * @global object $activities_template
     956     * @since 1.2.0
     957     *
    632958     * @param array $args optional
    633      * @return string
     959     *
     960     * @global object $bp BuddyPress global settings
     961     * @global object $activities_template {@link BP_Activity_Template}
     962     * @uses wp_parse_args()
     963     * @uses get_blog_option()
     964     * @uses apply_filters() To call the 'bp_get_activity_secondary_avatar_object_' . $activities_template->activity->component hook
     965     * @uses apply_filters() To call the 'bp_get_activity_secondary_avatar_item_id' hook
     966     * @uses bp_core_fetch_avatar()
     967     * @uses apply_filters() To call the 'bp_get_activity_secondary_avatar' hook
     968     *
     969     * @return string The secondary avatar
    634970     */
    635971    function bp_get_activity_secondary_avatar( $args = '' ) {
     
    6951031    }
    6961032
     1033/**
     1034 * Output the activity action
     1035 *
     1036 * @since 1.2.0
     1037 *
     1038 * @uses bp_get_activity_action()
     1039 */
    6971040function bp_activity_action() {
    6981041    echo bp_get_activity_action();
    6991042}
     1043
     1044    /**
     1045     * Return the activity action
     1046     *
     1047     * @since 1.2.0
     1048     *
     1049     * @global object $activities_template {@link BP_Activity_Template}
     1050     * @uses apply_filters_ref_array() To call the 'bp_get_activity_action_pre_meta' hook
     1051     * @uses bp_insert_activity_meta()
     1052     * @uses apply_filters_ref_array() To call the 'bp_get_activity_action' hook
     1053     *
     1054     * @return string The activity action
     1055     */
    7001056    function bp_get_activity_action() {
    7011057        global $activities_template;
     
    7101066    }
    7111067
     1068/**
     1069 * Output the activity content body
     1070 *
     1071 * @since 1.2.0
     1072 *
     1073 * @uses bp_get_activity_content_body()
     1074 */
    7121075function bp_activity_content_body() {
    7131076    echo bp_get_activity_content_body();
    7141077}
     1078
     1079    /**
     1080     * Return the activity content body
     1081     *
     1082     * @since 1.2.0
     1083     *
     1084     * @global object $activities_template {@link BP_Activity_Template}
     1085     * @uses bp_insert_activity_meta()
     1086     * @uses apply_filters_ref_array() To call the 'bp_get_activity_content_body' hook
     1087     *
     1088     * @return string The activity content body
     1089     */
    7151090    function bp_get_activity_content_body() {
    7161091        global $activities_template;
     
    7231098    }
    7241099
    725     function bp_activity_has_content() {
    726         global $activities_template;
    727 
    728         if ( !empty( $activities_template->activity->content ) )
    729             return true;
    730 
    731         return false;
    732     }
    733 
     1100/**
     1101 * Does the activity have content?
     1102 *
     1103 * @since 1.2.0
     1104 *
     1105 * @global object $activities_template {@link BP_Activity_Template}
     1106 *
     1107 * @return bool True if activity has content, false otherwise
     1108 */
     1109function bp_activity_has_content() {
     1110    global $activities_template;
     1111
     1112    if ( !empty( $activities_template->activity->content ) )
     1113        return true;
     1114
     1115    return false;
     1116}
     1117
     1118/**
     1119 * Output the activity content
     1120 *
     1121 * @since 1.0.0
     1122 * @deprecated 1.5.0
     1123 *
     1124 * @todo properly deprecate this function
     1125 *
     1126 * @uses bp_get_activity_content()
     1127 */
    7341128function bp_activity_content() {
    7351129    echo bp_get_activity_content();
    7361130}
     1131
     1132    /**
     1133     * Return the activity content
     1134     *
     1135     * @since 1.0.0
     1136     * @deprecated 1.5.0
     1137     *
     1138     * @todo properly deprecate this function
     1139     *
     1140     * @global object $activities_template {@link BP_Activity_Template}
     1141     * @uses bp_get_activity_action()
     1142     * @uses bp_get_activity_content_body()
     1143     * @uses apply_filters() To call the 'bp_get_activity_content' hook
     1144     *
     1145     * @return string The activity content
     1146     */
    7371147    function bp_get_activity_content() {
    7381148        global $activities_template;
    7391149
    740         /***
     1150        /**
    7411151         * If you want to filter activity update content, please use
    7421152         * the filter 'bp_get_activity_content_body'
     
    7491159    }
    7501160
    751     function bp_insert_activity_meta( $content ) {
    752         global $activities_template, $bp;
    753 
    754         // Strip any legacy time since placeholders from BP 1.0-1.1
    755         $content = str_replace( '<span class="time-since">%s</span>', '', $content );
    756 
    757         // Insert the time since.
    758         $time_since = apply_filters_ref_array( 'bp_activity_time_since', array( '<span class="time-since">' . bp_core_time_since( $activities_template->activity->date_recorded ) . '</span>', &$activities_template->activity ) );
    759 
    760         // Insert the permalink
    761         if ( !bp_is_single_activity() )
    762             $content = apply_filters_ref_array( 'bp_activity_permalink', array( sprintf( '%1$s <a href="%2$s" class="view activity-time-since" title="%3$s">%4$s</a>', $content, bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ), esc_attr__( 'View Discussion', 'buddypress' ), $time_since ), &$activities_template->activity ) );
    763         else
    764             $content .= str_pad( $time_since, strlen( $time_since ) + 2, ' ', STR_PAD_BOTH );
    765 
    766         return apply_filters( 'bp_insert_activity_meta', $content );
    767     }
    768 
     1161/**
     1162 * Insert activity meta
     1163 *
     1164 * @since 1.2.0
     1165 *
     1166 * @param string $content
     1167 *
     1168 * @global object $activities_template {@link BP_Activity_Template}
     1169 * @global object $bp BuddyPress global settings
     1170 * @uses bp_core_time_since()
     1171 * @uses apply_filters_ref_array() To call the 'bp_activity_time_since' hook
     1172 * @uses bp_is_single_activity()
     1173 * @uses bp_activity_get_permalink()
     1174 * @uses esc_attr__()
     1175 * @uses apply_filters_ref_array() To call the 'bp_activity_permalink' hook
     1176 * @uses apply_filters() To call the 'bp_insert_activity_meta' hook
     1177 *
     1178 * @return string The activity content
     1179 */
     1180function bp_insert_activity_meta( $content ) {
     1181    global $activities_template, $bp;
     1182
     1183    // Strip any legacy time since placeholders from BP 1.0-1.1
     1184    $content = str_replace( '<span class="time-since">%s</span>', '', $content );
     1185
     1186    // Insert the time since.
     1187    $time_since = apply_filters_ref_array( 'bp_activity_time_since', array( '<span class="time-since">' . bp_core_time_since( $activities_template->activity->date_recorded ) . '</span>', &$activities_template->activity ) );
     1188
     1189    // Insert the permalink
     1190    if ( !bp_is_single_activity() )
     1191        $content = apply_filters_ref_array( 'bp_activity_permalink', array( sprintf( '%1$s <a href="%2$s" class="view activity-time-since" title="%3$s">%4$s</a>', $content, bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ), esc_attr__( 'View Discussion', 'buddypress' ), $time_since ), &$activities_template->activity ) );
     1192    else
     1193        $content .= str_pad( $time_since, strlen( $time_since ) + 2, ' ', STR_PAD_BOTH );
     1194
     1195    return apply_filters( 'bp_insert_activity_meta', $content );
     1196}
     1197
     1198/**
     1199 * Determine if the current user can delete an activity item
     1200 *
     1201 * @since 1.2.0
     1202 *
     1203 * @param object $activity Optional
     1204 *
     1205 * @global object $activities_template {@link BP_Activity_Template}
     1206 * @global object $bp BuddyPress global settings
     1207 * @uses apply_filters() To call the 'bp_activity_user_can_delete' hook
     1208 *
     1209 * @return bool True if can delete, false otherwise
     1210 */
    7691211function bp_activity_user_can_delete( $activity = false ) {
    7701212    global $activities_template, $bp;
     
    7901232}
    7911233
     1234/**
     1235 * Output the activity parent content
     1236 *
     1237 * @since 1.2.0
     1238 *
     1239 * @param array $args Optional
     1240 *
     1241 * @uses bp_get_activity_parent_content()
     1242 */
    7921243function bp_activity_parent_content( $args = '' ) {
    7931244    echo bp_get_activity_parent_content($args);
    7941245}
     1246
     1247    /**
     1248     * Return the activity content
     1249     *
     1250     * @since 1.2.0
     1251     *
     1252     * @param array $args Optional
     1253     *
     1254     * @global object $bp BuddyPress global settings
     1255     * @global object $activities_template {@link BP_Activity_Template}
     1256     * @uses wp_parse_args()
     1257     * @uses apply_filters() To call the 'bp_get_activity_parent_content' hook
     1258     *
     1259     * @return mixed False on failure, otherwise the activity parent content
     1260     */
    7951261    function bp_get_activity_parent_content( $args = '' ) {
    7961262        global $bp, $activities_template;
     
    8251291    }
    8261292
     1293/**
     1294 * Output whether or not the current activity is in a current user's favorites
     1295 *
     1296 * @since 1.2.0
     1297 *
     1298 * @uses bp_get_activity_is_favorite()
     1299 */
    8271300function bp_activity_is_favorite() {
    8281301    echo bp_get_activity_is_favorite();
    8291302}
     1303
     1304    /**
     1305     * Return whether or not the current activity is in a current user's favorites
     1306     *
     1307     * @since 1.2.0
     1308     *
     1309     * @global object $bp BuddyPress global settings
     1310     * @global object $activities_template {@link BP_Activity_Template}
     1311     * @uses apply_filters() To call the 'bp_get_activity_is_favorite' hook
     1312     *
     1313     * @return bool True if user favorite, false otherwise
     1314     */
    8301315    function bp_get_activity_is_favorite() {
    8311316        global $bp, $activities_template;
     
    8371322 * Echoes the comment markup for an activity item
    8381323 *
    839  * @package BuddyPress
    840  * @subpackage Activity Template
    841  *
    842  * @param str $args Unused
     1324 * @since 1.2.0
     1325 *
     1326 * @todo deprecate $args param
     1327 *
     1328 * @param string $args Unused. Appears to be left over from an earlier implementation.
    8431329 */
    8441330function bp_activity_comments( $args = '' ) {
    8451331    echo bp_activity_get_comments( $args );
    8461332}
     1333
    8471334    /**
    8481335     * Gets the comment markup for an activity item
    8491336     *
    850      * @package BuddyPress
    851      * @subpackage Activity Template
    852      *
    853      * @param str $args Unused. Appears to be left over from an earlier implementation.
     1337     * @since 1.2.0
     1338     *
     1339     * @todo deprecate $args param
     1340     *
    8541341     * @todo Given that checks for children already happen in bp_activity_recurse_comments(),
    8551342     *    this function can probably be streamlined or removed.
     1343     *
     1344     * @param string $args Unused. Appears to be left over from an earlier implementation.
     1345     *
     1346     * @global object $activities_template {@link BP_Activity_Template}
     1347     * @global object $bp BuddyPress global settings
     1348     * @uses bp_activity_recurse_comments()
    8561349     */
    8571350    function bp_activity_get_comments( $args = '' ) {
     
    8701363         * split between here and the comment.php template.
    8711364         *
    872          * @package BuddyPress
    873          * @subpackage Activity Template
     1365         * @since 1.2.0
    8741366         *
    875          * @param obj $comment The activity object currently being recursed
     1367         * @todo remove $counter global
     1368         *
     1369         * @param object $comment The activity object currently being recursed
     1370         *
     1371         * @global object $activities_template {@link BP_Activity_Template}
     1372         * @global object $bp BuddyPress global settings
     1373         * @uses locate_template()
    8761374         */
    8771375        function bp_activity_recurse_comments( $comment ) {
     
    9091407 * Utility function that returns the comment currently being recursed
    9101408 *
    911  * @package BuddyPress
    912  * @subpackage Activity Template
    913  * @since 1.5
    914  *
    915  * @return obj $current_comment The activity comment currently being displayed
     1409 * @since 1.5.0
     1410 *
     1411 * @global object $activities_template {@link BP_Activity_Template}
     1412 * @uses apply_filters() To call the 'bp_activity_current_comment' hook
     1413 *
     1414 * @return object|bool $current_comment The activity comment currently being displayed. False on failure
    9161415 */
    9171416function bp_activity_current_comment() {
     
    9271426 * Echoes the id of the activity comment currently being displayed
    9281427 *
    929  * @package BuddyPress
    930  * @subpackage Activity Template
    931  * @since 1.5
     1428 * @since 1.5.0
     1429 *
     1430 * @uses bp_get_activity_comment_id()
    9321431 */
    9331432function bp_activity_comment_id() {
    9341433    echo bp_get_activity_comment_id();
    9351434}
     1435
    9361436    /**
    9371437     * Gets the id of the activity comment currently being displayed
    9381438     *
    939      * @package BuddyPress
    940      * @subpackage Activity Template
    941      * @since 1.5
     1439     * @since 1.5.0
     1440     *
     1441     * @global object $activities_template {@link BP_Activity_Template}
     1442     * @uses apply_filters() To call the 'bp_activity_comment_id' hook
    9421443     *
    9431444     * @return int $comment_id The id of the activity comment currently being displayed
     
    9541455 * Echoes the user_id of the author of the activity comment currently being displayed
    9551456 *
    956  * @package BuddyPress
    957  * @subpackage Activity Template
    958  * @since 1.5
     1457 * @since 1.5.0
     1458 *
     1459 * @uses bp_get_activity_comment_user_id()
    9591460 */
    9601461function bp_activity_comment_user_id() {
    9611462    echo bp_get_activity_comment_user_id();
    9621463}
     1464
    9631465    /**
    9641466     * Gets the user_id of the author of the activity comment currently being displayed
    9651467     *
    966      * @package BuddyPress
    967      * @subpackage Activity Template
    968      * @since 1.5
    969      *
    970      * @return int $user_id The user_id of the author of the displayed activity comment
     1468     * @since 1.5.0
     1469     *
     1470     * @global object $activities_template {@link BP_Activity_Template}
     1471     * @uses apply_filters() To call the 'bp_activity_comment_user_id' hook
     1472     *
     1473     * @return int|bool $user_id The user_id of the author of the displayed activity comment. False on failure
    9711474     */
    9721475    function bp_get_activity_comment_user_id() {
     
    9811484 * Echoes the author link for the activity comment currently being displayed
    9821485 *
    983  * @package BuddyPress
    984  * @subpackage Activity Template
    985  * @since 1.5
     1486 * @since 1.5.0
     1487 *
     1488 * @uses bp_get_activity_comment_user_link()
    9861489 */
    9871490function bp_activity_comment_user_link() {
    9881491    echo bp_get_activity_comment_user_link();
    9891492}
     1493
    9901494    /**
    9911495     * Gets the author link for the activity comment currently being displayed
    9921496     *
    993      * @package BuddyPress
    994      * @subpackage Activity Template
    995      * @since 1.5
    996      *
    997      * @return str $user_link The URL of the activity comment author's profile
     1497     * @since 1.5.0
     1498     *
     1499     * @uses bp_core_get_user_domain()
     1500     * @uses bp_get_activity_comment_user_id()
     1501     * @uses apply_filters() To call the 'bp_activity_comment_user_link' hook
     1502     *
     1503     * @return string $user_link The URL of the activity comment author's profile
    9981504     */
    9991505    function bp_get_activity_comment_user_link() {
     
    10061512 * Echoes the author name for the activity comment currently being displayed
    10071513 *
    1008  * @package BuddyPress
    1009  * @subpackage Activity Template
    1010  * @since 1.5
     1514 * @since 1.5.0
     1515 *
     1516 * @uses bp_get_activity_comment_name()
    10111517 */
    10121518function bp_activity_comment_name() {
    10131519    echo bp_get_activity_comment_name();
    10141520}
     1521
    10151522    /**
    10161523     * Gets the author name for the activity comment currently being displayed
     
    10181525     * The use of the bp_acomment_name filter is deprecated. Please use bp_activity_comment_name
    10191526     *
    1020      * @package BuddyPress
    1021      * @subpackage Activity Template
    1022      * @since 1.5
    1023      *
    1024      * @return str $name The full name of the activity comment author
     1527     * @since 1.5.0
     1528     *
     1529     * @global object $activities_template {@link BP_Activity_Template}
     1530     * @uses apply_filters() To call the 'bp_acomment_name' hook
     1531     * @uses apply_filters() To call the 'bp_activity_comment_name' hook
     1532     *
     1533     * @return string $name The full name of the activity comment author
    10251534     */
    10261535    function bp_get_activity_comment_name() {
     
    10351544 * Echoes the date_recorded of the activity comment currently being displayed
    10361545 *
    1037  * @package BuddyPress
    1038  * @subpackage Activity Template
    1039  * @since 1.5
     1546 * @since 1.5.0
     1547 *
     1548 * @uses bp_get_activity_comment_date_recorded()
    10401549 */
    10411550function bp_activity_comment_date_recorded() {
    10421551    echo bp_get_activity_comment_date_recorded();
    10431552}
     1553
    10441554    /**
    10451555     * Gets the date_recorded for the activity comment currently being displayed
    10461556     *
    1047      * @package BuddyPress
    1048      * @subpackage Activity Template
    1049      * @since 1.5
    1050      *
    1051      * @return str $date_recorded Time since the activity was recorded, of the form "%s ago"
     1557     * @since 1.5.0
     1558     *
     1559     * @global object $activities_template {@link BP_Activity_Template}
     1560     * @uses bp_core_time_since()
     1561     * @uses apply_filters() To call the 'bp_activity_comment_date_recorded' hook
     1562     *
     1563     * @return string|bool $date_recorded Time since the activity was recorded, of the form "%s ago". False on failure
    10521564     */
    10531565    function bp_get_activity_comment_date_recorded() {
     
    10651577 * Echoes the 'delete' URL for the activity comment currently being displayed
    10661578 *
    1067  * @package BuddyPress
    1068  * @subpackage Activity Template
    1069  * @since 1.5
     1579 * @since 1.5.0
     1580 *
     1581 * @uses bp_get_activity_comment_delete_link()
    10701582 */
    10711583function bp_activity_comment_delete_link() {
    10721584    echo bp_get_activity_comment_delete_link();
    10731585}
     1586
    10741587    /**
    10751588     * Gets the 'delete' URL for the activity comment currently being displayed
    10761589     *
    1077      * @package BuddyPress
    1078      * @subpackage Activity Template
    1079      * @since 1.5
    1080      *
    1081      * @return str $link The nonced URL for deleting the current activity comment
     1590     * @since 1.5.0
     1591     *
     1592     * @global object $bp BuddyPress global settings
     1593     * @uses wp_nonce_url()
     1594     * @uses bp_get_root_domain()
     1595     * @uses bp_get_activity_slug()
     1596     * @uses bp_get_activity_comment_id()
     1597     * @uses apply_filters() To call the 'bp_activity_comment_delete_link' hook
     1598     *
     1599     * @return string $link The nonced URL for deleting the current activity comment
    10821600     */
    10831601    function bp_get_activity_comment_delete_link() {
     
    10921610 * Echoes the content of the activity comment currently being displayed
    10931611 *
    1094  * @package BuddyPress
    1095  * @subpackage Activity Template
    1096  * @since 1.5
     1612 * @since 1.5.0
     1613 *
     1614 * @uses bp_get_activity_comment_content()
    10971615 */
    10981616function bp_activity_comment_content() {
    10991617    echo bp_get_activity_comment_content();
    11001618}
     1619
    11011620    /**
    11021621     * Gets the content of the activity comment currently being displayed
     
    11061625     * content of activity comments only.
    11071626     *
    1108      * @package BuddyPress
    1109      * @subpackage Activity Template
    1110      * @since 1.5
    1111      *
    1112      * @return str $content The content of the current activity comment
     1627     * @since 1.5.0
     1628     *
     1629     * @global object $activities_template {@link BP_Activity_Template}
     1630     * @uses apply_filters() To call the 'bp_get_activity_content' hook
     1631     * @uses apply_filters() To call the 'bp_activity_comment_content' hook
     1632     *
     1633     * @return string $content The content of the current activity comment
    11131634     */
    11141635    function bp_get_activity_comment_content() {
     
    11201641    }
    11211642
     1643/**
     1644 * Echoes the activity comment count
     1645 *
     1646 * @since 1.2.0
     1647 *
     1648 * @uses bp_activity_get_comment_count()
     1649 */
    11221650function bp_activity_comment_count() {
    11231651    echo bp_activity_get_comment_count();
    11241652}
     1653
     1654    /**
     1655     * Gets the content of the activity comment currently being displayed
     1656     *
     1657     * The content is run through two filters. bp_get_activity_content will apply all filters
     1658     * applied to activity items in general. Use bp_activity_comment_content to modify the
     1659     * content of activity comments only.
     1660     *
     1661     * @since 1.2.0
     1662     *
     1663     * @todo deprecate $args
     1664     *
     1665     * @global object $activities_template {@link BP_Activity_Template}
     1666     * @global object $bp BuddyPress global settings
     1667     * @uses bp_activity_recurse_comment_count()
     1668     * @uses apply_filters() To call the 'bp_activity_get_comment_count' hook
     1669     *
     1670     * @return int $count The activity comment count. Defaults to zero
     1671     */
    11251672    function bp_activity_get_comment_count( $args = '' ) {
    11261673        global $activities_template, $bp;
     
    11331680        return apply_filters( 'bp_activity_get_comment_count', (int)$count );
    11341681    }
     1682
     1683        /**
     1684         * Gets the content of the activity comment currently being displayed
     1685         *
     1686         * The content is run through two filters. bp_get_activity_content will apply all filters
     1687         * applied to activity items in general. Use bp_activity_comment_content to modify the
     1688         * content of activity comments only.
     1689         *
     1690         * @since 1.2.0
     1691         *
     1692         * @todo investigate why bp_activity_recurse_comment_count() is used while being declared
     1693         *
     1694         * @param object $comment Activity comments object
     1695         *
     1696         * @global object $activities_template {@link BP_Activity_Template}
     1697         * @global object $bp BuddyPress global settings
     1698         * @uses bp_activity_recurse_comment_count()
     1699         * @uses apply_filters() To call the 'bp_activity_get_comment_count' hook
     1700         *
     1701         * @return int $count The activity comment count.
     1702         */
    11351703        function bp_activity_recurse_comment_count( $comment, $count = 0 ) {
    11361704            global $activities_template, $bp;
     
    11471715        }
    11481716
     1717/**
     1718 * Echoes the activity comment link
     1719 *
     1720 * @since 1.2.0
     1721 *
     1722 * @uses bp_get_activity_comment_link()
     1723 */
    11491724function bp_activity_comment_link() {
    11501725    echo bp_get_activity_comment_link();
    11511726}
     1727
     1728    /**
     1729     * Gets the activity comment link
     1730     *
     1731     * @since 1.2.0
     1732     *
     1733     * @global object $activities_template {@link BP_Activity_Template}
     1734     * @uses apply_filters() To call the 'bp_get_activity_comment_link' hook
     1735     *
     1736     * @return string The activity comment link
     1737     */
    11521738    function bp_get_activity_comment_link() {
    11531739        global $activities_template;
     
    11551741    }
    11561742
     1743/**
     1744 * Echoes the activity comment form no javascript display CSS
     1745 *
     1746 * @since 1.2.0
     1747 *
     1748 * @uses bp_get_activity_comment_form_nojs_display()
     1749 */
    11571750function bp_activity_comment_form_nojs_display() {
    11581751    echo bp_get_activity_comment_form_nojs_display();
    11591752}
     1753
     1754    /**
     1755     * Gets the activity comment form no javascript display CSS
     1756     *
     1757     * @since 1.2.0
     1758     *
     1759     * @global object $activities_template {@link BP_Activity_Template}
     1760     *
     1761     * @return string|bool The activity comment form no javascript display CSS. False on failure
     1762     */
    11601763    function bp_get_activity_comment_form_nojs_display() {
    11611764        global $activities_template;
     
    11661769    }
    11671770
     1771/**
     1772 * Echoes the activity comment form action
     1773 *
     1774 * @since 1.2.0
     1775 *
     1776 * @uses bp_get_activity_comment_form_action()
     1777 */
    11681778function bp_activity_comment_form_action() {
    11691779    echo bp_get_activity_comment_form_action();
    11701780}
     1781
     1782    /**
     1783     * Gets the activity comment form action
     1784     *
     1785     * @since 1.2.0
     1786     *
     1787     * @global object $bp BuddyPress global settings
     1788     * @uses home_url()
     1789     * @uses bp_get_activity_root_slug()
     1790     * @uses apply_filters() To call the 'bp_get_activity_comment_form_action' hook
     1791     *
     1792     * @return string The activity comment form action
     1793     */
    11711794    function bp_get_activity_comment_form_action() {
    11721795        global $bp;
     
    11751798    }
    11761799
     1800/**
     1801 * Echoes the activity permalink id
     1802 *
     1803 * @since 1.2.0
     1804 *
     1805 * @uses bp_get_activity_permalink_id()
     1806 */
    11771807function bp_activity_permalink_id() {
    11781808    echo bp_get_activity_permalink_id();
    11791809}
     1810
     1811    /**
     1812     * Gets the activity permalink id
     1813     *
     1814     * @since 1.2.0
     1815     *
     1816     * @global object $bp BuddyPress global settings
     1817     * @uses apply_filters() To call the 'bp_get_activity_permalink_id' hook
     1818     *
     1819     * @return string The activity permalink id
     1820     */
    11801821    function bp_get_activity_permalink_id() {
    11811822        global $bp;
     
    11841825    }
    11851826
     1827/**
     1828 * Echoes the activity thread permalink
     1829 *
     1830 * @since 1.2.0
     1831 *
     1832 * @uses bp_get_activity_permalink_id()
     1833 */
    11861834function bp_activity_thread_permalink() {
    11871835    echo bp_get_activity_thread_permalink();
    11881836}
     1837
     1838    /**
     1839     * Gets the activity thread permalink
     1840     *
     1841     * @since 1.2.0
     1842     *
     1843     * @global object $bp BuddyPress global settings
     1844     * @uses bp_activity_get_permalink()
     1845     * @uses apply_filters() To call the 'bp_get_activity_thread_permalink' hook
     1846     *
     1847     * @return string $link The activity thread permalink
     1848     */
    11891849    function bp_get_activity_thread_permalink() {
    11901850        global $bp, $activities_template;
     
    11951855    }
    11961856
     1857/**
     1858 * Echoes the activity favorite link
     1859 *
     1860 * @since 1.2.0
     1861 *
     1862 * @uses bp_get_activity_favorite_link()
     1863 */
    11971864function bp_activity_favorite_link() {
    11981865    echo bp_get_activity_favorite_link();
    11991866}
     1867
     1868    /**
     1869     * Gets the activity favorite link
     1870     *
     1871     * @since 1.2.0
     1872     *
     1873     * @global object $bp BuddyPress global settings
     1874     * @global object $activities_template {@link BP_Activity_Template}
     1875     * @uses wp_nonce_url()
     1876     * @uses home_url()
     1877     * @uses bp_get_activity_root_slug()
     1878     * @uses apply_filters() To call the 'bp_get_activity_favorite_link' hook
     1879     *
     1880     * @return string The activity favorite link
     1881     */
    12001882    function bp_get_activity_favorite_link() {
    12011883        global $bp, $activities_template;
     
    12031885    }
    12041886
     1887/**
     1888 * Echoes the activity unfavorite link
     1889 *
     1890 * @since 1.2.0
     1891 *
     1892 * @uses bp_get_activity_unfavorite_link()
     1893 */
    12051894function bp_activity_unfavorite_link() {
    12061895    echo bp_get_activity_unfavorite_link();
    12071896}
     1897
     1898    /**
     1899     * Gets the activity unfavorite link
     1900     *
     1901     * @since 1.2.0
     1902     *
     1903     * @global object $bp BuddyPress global settings
     1904     * @global object $activities_template {@link BP_Activity_Template}
     1905     * @uses wp_nonce_url()
     1906     * @uses home_url()
     1907     * @uses bp_get_activity_root_slug()
     1908     * @uses apply_filters() To call the 'bp_get_activity_unfavorite_link' hook
     1909     *
     1910     * @return string The activity unfavorite link
     1911     */
    12081912    function bp_get_activity_unfavorite_link() {
    12091913        global $bp, $activities_template;
     
    12111915    }
    12121916
     1917/**
     1918 * Echoes the activity CSS class
     1919 *
     1920 * @since 1.0.0
     1921 *
     1922 * @uses bp_get_activity_css_class()
     1923 */
    12131924function bp_activity_css_class() {
    12141925    echo bp_get_activity_css_class();
    12151926}
     1927
     1928    /**
     1929     * Gets the activity CSS class
     1930     *
     1931     * @since 1.0.0
     1932     *
     1933     * @global object $activities_template {@link BP_Activity_Template}
     1934     * @uses apply_filters() To call the 'bp_activity_mini_activity_types' hook
     1935     * @uses bp_activity_get_comment_count()
     1936     * @uses bp_activity_can_comment()
     1937     * @uses apply_filters() To call the 'bp_get_activity_css_class' hook
     1938     *
     1939     * @return string The activity css class
     1940     */
    12161941    function bp_get_activity_css_class() {
    12171942        global $activities_template;
     
    12371962
    12381963/**
    1239  * bp_activity_delete_link()
    1240  *
    12411964 * Display the activity delete link.
    12421965 *
    1243  * @since 1.1
     1966 * @since 1.1.0
     1967 *
    12441968 * @uses bp_get_activity_delete_link()
    12451969 */
     
    12491973
    12501974    /**
    1251      * bp_get_activity_delete_link()
    1252      *
    12531975     * Return the activity delete link.
    12541976     *
    1255      * @global object $activities_template BuddyPress Activities Template
     1977     * @since 1.1.0
     1978     *
     1979     * @global object $activities_template {@link BP_Activity_Template}
    12561980     * @global object $bp BuddyPress global settings
     1981     * @uses bp_get_root_domain()
     1982     * @uses bp_get_activity_root_slug()
     1983     * @uses bp_is_activity_component()
     1984     * @uses bp_current_action()
     1985     * @uses add_query_arg()
     1986     * @uses wp_get_referer()
     1987     * @uses wp_nonce_url()
     1988     * @uses apply_filters() To call the 'bp_get_activity_delete_link' hook
     1989     *
    12571990     * @return string $link Activity delete link. Contains $redirect_to arg if on single activity page.
    1258      * @since 1.1
    12591991     */
    12601992    function bp_get_activity_delete_link() {
     
    12742006    }
    12752007
     2008/**
     2009 * Display the activity latest update link.
     2010 *
     2011 * @since 1.2.0
     2012 *
     2013 * @param int $user_id Defaults to 0
     2014 *
     2015 * @uses bp_get_activity_latest_update()
     2016 */
    12762017function bp_activity_latest_update( $user_id = 0 ) {
    12772018    echo bp_get_activity_latest_update( $user_id );
    12782019}
     2020
     2021    /**
     2022     * Return the activity latest update link.
     2023     *
     2024     * @since 1.2.0
     2025     *
     2026     * @param int $user_id Defaults to 0
     2027     *
     2028     * @global object $bp BuddyPress global settings
     2029     * @uses bp_core_is_user_spammer()
     2030     * @uses bp_core_is_user_deleted()
     2031     * @uses bp_get_user_meta()
     2032     * @uses apply_filters() To call the 'bp_get_activity_latest_update_excerpt' hook
     2033     * @uses bp_create_excerpt()
     2034     * @uses bp_get_root_domain()
     2035     * @uses bp_get_activity_root_slug()
     2036     * @uses apply_filters() To call the 'bp_get_activity_latest_update' hook
     2037     *
     2038     * @return string|bool $latest_update The activity latest update link. False on failure
     2039     */
    12792040    function bp_get_activity_latest_update( $user_id = 0 ) {
    12802041        global $bp;
     
    12952056    }
    12962057
     2058/**
     2059 * Display the activity filter links.
     2060 *
     2061 * @since 1.1.0
     2062 *
     2063 * @param array $args Defaults to false
     2064 *
     2065 * @uses bp_get_activity_filter_links()
     2066 */
    12972067function bp_activity_filter_links( $args = false ) {
    12982068    echo bp_get_activity_filter_links( $args );
    12992069}
     2070
     2071    /**
     2072     * Return the activity filter links.
     2073     *
     2074     * @since 1.1.0
     2075     *
     2076     * @param array $args Defaults to false
     2077     *
     2078     * @global object $activities_template {@link BP_Activity_Template}
     2079     * @global object $bp BuddyPress global settings
     2080     * @uses wp_parse_args()
     2081     * @uses BP_Activity_Activity::get_recorded_components() {@link BP_Activity_Activity}
     2082     * @uses esc_attr()
     2083     * @uses add_query_arg()
     2084     * @uses remove_query_arg()
     2085     * @uses apply_filters() To call the 'bp_get_activity_filter_link_href' hook
     2086     * @uses apply_filters() To call the 'bp_get_activity_filter_links' hook
     2087     *
     2088     * @return string|bool $component_links The activity filter links. False on failure
     2089     */
    13002090    function bp_get_activity_filter_links( $args = false ) {
    13012091        global $activities_template, $bp;
     
    13632153    }
    13642154
     2155/**
     2156 * Determine if a comment can be made on an activity item
     2157 *
     2158 * @since 1.2.0
     2159 *
     2160 * @global object $activities_template {@link BP_Activity_Template}
     2161 * @global object $bp BuddyPress global settings
     2162 * @uses bp_get_activity_action_name()
     2163 * @uses apply_filters() To call the 'bp_activity_can_comment' hook
     2164 *
     2165 * @return bool $can_comment Defaults to true
     2166 */
    13652167function bp_activity_can_comment() {
    13662168    global $activities_template, $bp;
     
    13792181}
    13802182
     2183/**
     2184 * Determine if a comment can be made on an activity reply item
     2185 *
     2186 * @since 1.5.0
     2187 *
     2188 * @param object $comment Activity comment
     2189 *
     2190 * @uses apply_filters() To call the 'bp_activity_can_comment_reply' hook
     2191 *
     2192 * @return bool $can_comment Defaults to true
     2193 */
    13812194function bp_activity_can_comment_reply( $comment ) {
    13822195    $can_comment = true;
     
    13852198}
    13862199
     2200/**
     2201 * Determine if an favorites are allowed
     2202 *
     2203 * @since 1.5.0
     2204 *
     2205 * @uses apply_filters() To call the 'bp_activity_can_favorite' hook
     2206 *
     2207 * @return bool $can_favorite Defaults to true
     2208 */
    13872209function bp_activity_can_favorite() {
    13882210    $can_favorite = true;
     
    13912213}
    13922214
     2215/**
     2216 * Echoes the total favorite count for a specified user
     2217 *
     2218 * @since 1.2.0
     2219 *
     2220 * @param int $user_id Defaults to 0
     2221 *
     2222 * @uses bp_get_total_favorite_count_for_user()
     2223 */
    13932224function bp_total_favorite_count_for_user( $user_id = 0 ) {
    13942225    echo bp_get_total_favorite_count_for_user( $user_id );
    13952226}
     2227
     2228    /**
     2229     * Returns the total favorite count for a specified user
     2230     *
     2231     * @since 1.2.0
     2232     *
     2233     * @param int $user_id Defaults to 0
     2234     *
     2235     * @uses bp_activity_total_favorites_for_user()
     2236     * @uses apply_filters() To call the 'bp_get_total_favorite_count_for_user' hook
     2237     *
     2238     * @return int The total favorite count for a specified user
     2239     */
    13962240    function bp_get_total_favorite_count_for_user( $user_id = 0 ) {
    13972241        return apply_filters( 'bp_get_total_favorite_count_for_user', bp_activity_total_favorites_for_user( $user_id ) );
    13982242    }
    13992243
     2244/**
     2245 * Echoes the total mention count for a specified user
     2246 *
     2247 * @since 1.2.0
     2248 *
     2249 * @param int $user_id Defaults to 0
     2250 *
     2251 * @uses bp_get_total_favorite_count_for_user()
     2252 */
    14002253function bp_total_mention_count_for_user( $user_id = 0 ) {
    14012254    echo bp_get_total_favorite_count_for_user( $user_id );
    14022255}
     2256
     2257    /**
     2258     * Returns the total mention count for a specified user
     2259     *
     2260     * @since 1.2.0
     2261     *
     2262     * @todo remove unnecessary $bp global
     2263     *
     2264     * @param int $user_id Defaults to 0
     2265     *
     2266     * @uses bp_get_user_meta()
     2267     * @uses apply_filters() To call the 'bp_get_total_mention_count_for_user' hook
     2268     *
     2269     * @return int The total mention count for a specified user
     2270     */
    14032271    function bp_get_total_mention_count_for_user( $user_id = 0 ) {
    14042272        global $bp;
     
    14072275    }
    14082276
     2277/**
     2278 * Echoes the public message link for displayed user
     2279 *
     2280 * @since 1.2.0
     2281 *
     2282 * @uses bp_get_send_public_message_link()
     2283 */
    14092284function bp_send_public_message_link() {
    14102285    echo bp_get_send_public_message_link();
    14112286}
     2287
     2288    /**
     2289     * Returns the public message link for displayed user
     2290     *
     2291     * @since 1.2.0
     2292     *
     2293     * @global object $bp BuddyPress global settings
     2294     * @uses bp_is_my_profile()
     2295     * @uses is_user_logged_in()
     2296     * @uses wp_nonce_url()
     2297     * @uses bp_loggedin_user_domain()
     2298     * @uses bp_get_activity_slug()
     2299     * @uses bp_core_get_username()
     2300     * @uses apply_filters() To call the 'bp_get_send_public_message_link' hook
     2301     *
     2302     * @return string The public message link for displayed user
     2303     */
    14122304    function bp_get_send_public_message_link() {
    14132305        global $bp;
     
    14192311    }
    14202312
     2313/**
     2314 * Echoes the mentioned user display name
     2315 *
     2316 * @since 1.2.0
     2317 *
     2318 * @param int|string User id or username
     2319 *
     2320 * @uses bp_get_mentioned_user_display_name()
     2321 */
    14212322function bp_mentioned_user_display_name( $user_id_or_username ) {
    14222323    echo bp_get_mentioned_user_display_name( $user_id_or_username );
    14232324}
     2325
     2326    /**
     2327     * Returns the mentioned user display name
     2328     *
     2329     * @since 1.2.0
     2330     *
     2331     * @param int|string User id or username
     2332     *
     2333     * @uses bp_core_get_user_displayname()
     2334     * @uses apply_filters() To call the 'bp_get_mentioned_user_display_name' hook
     2335     *
     2336     * @return string The mentioned user display name
     2337     */
    14242338    function bp_get_mentioned_user_display_name( $user_id_or_username ) {
    14252339        if ( !$name = bp_core_get_user_displayname( $user_id_or_username ) )
     
    14302344
    14312345/**
    1432  * bp_send_public_message_button( $args )
    1433  *
    14342346 * Output button for sending a public message
    14352347 *
    1436  * @param array $args
     2348 * @since 1.2.0
     2349 *
     2350 * @param array $args Optional
     2351 *
     2352 * @uses bp_get_send_public_message_button()
    14372353 */
    14382354function bp_send_public_message_button( $args = '' ) {
    14392355    echo bp_get_send_public_message_button( $args );
    14402356}
    1441     /**
    1442      * bp_get_send_public_message_button( $args )
    1443      *
     2357
     2358    /**
    14442359     * Return button for sending a public message
    14452360     *
    1446      * @param array $args
    1447      * @return string
     2361     * @since 1.2.0
     2362     *
     2363     * @param array $args Optional
     2364     *
     2365     * @uses bp_get_send_public_message_link()
     2366     * @uses wp_parse_args()
     2367     * @uses bp_get_button()
     2368     * @uses apply_filters() To call the 'bp_get_send_public_message_button' hook
     2369     *
     2370     * @return string The button for sending a public message
    14482371     */
    14492372    function bp_get_send_public_message_button( $args = '' ) {
     
    14662389    }
    14672390
     2391/**
     2392 * Outputs the activity post form action
     2393 *
     2394 * @since 1.2.0
     2395 *
     2396 * @uses bp_get_activity_post_form_action()
     2397 */
    14682398function bp_activity_post_form_action() {
    14692399    echo bp_get_activity_post_form_action();
    14702400}
     2401
     2402    /**
     2403     * Returns the activity post form action
     2404     *
     2405     * @since 1.2.0
     2406     *
     2407     * @uses home_url()
     2408     * @uses bp_get_activity_root_slug()
     2409     * @uses apply_filters() To call the 'bp_get_activity_post_form_action' hook
     2410     *
     2411     * @return string The activity post form action
     2412     */
    14712413    function bp_get_activity_post_form_action() {
    14722414        return apply_filters( 'bp_get_activity_post_form_action', home_url( bp_get_activity_root_slug() . '/post/' ) );
    14732415    }
    14742416
    1475 /* RSS Feed Template Tags ***************************/
    1476 
     2417/* RSS Feed Template Tags ****************************************************/
     2418
     2419/**
     2420 * Outputs the sitewide activity feed link
     2421 *
     2422 * @since 1.0.0
     2423 *
     2424 * @uses bp_get_sitewide_activity_feed_link()
     2425 */
    14772426function bp_sitewide_activity_feed_link() {
    14782427    echo bp_get_sitewide_activity_feed_link();
    14792428}
     2429
     2430    /**
     2431     * Returns the sitewide activity feed link
     2432     *
     2433     * @since 1.0.0
     2434     *
     2435     * @uses home_url()
     2436     * @uses bp_get_activity_root_slug()
     2437     * @uses apply_filters() To call the 'bp_get_sitewide_activity_feed_link' hook
     2438     *
     2439     * @return string The sitewide activity feed link
     2440     */
    14802441    function bp_get_sitewide_activity_feed_link() {
    14812442        return apply_filters( 'bp_get_sitewide_activity_feed_link', home_url( bp_get_activity_root_slug() . '/feed/' ) );
    14822443    }
    14832444
     2445/**
     2446 * Outputs the member activity feed link
     2447 *
     2448 * @since 1.2.0
     2449 *
     2450 * @uses bp_get_member_activity_feed_link()
     2451 */
    14842452function bp_member_activity_feed_link() {
    14852453    echo bp_get_member_activity_feed_link();
    14862454}
    1487 function bp_activities_member_rss_link() {
    1488     echo bp_get_member_activity_feed_link();
    1489 }
    1490 
     2455
     2456/**
     2457 * Outputs the member activity feed link
     2458 *
     2459 * @since 1.0.0
     2460 * @deprecated 1.2.0
     2461 *
     2462 * @todo properly deprecated in favor of bp_member_activity_feed_link()
     2463 *
     2464 * @uses bp_get_member_activity_feed_link()
     2465 */
     2466function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link(); }
     2467
     2468    /**
     2469     * Returns the member activity feed link
     2470     *
     2471     * @since 1.2.0
     2472     *
     2473     * @uses bp_is_profile_component()
     2474     * @uses bp_is_current_action()
     2475     * @uses bp_displayed_user_domain()
     2476     * @uses bp_get_activity_slug()
     2477     * @uses bp_is_active()
     2478     * @uses bp_get_friends_slug()
     2479     * @uses bp_get_groups_slug()
     2480     * @uses apply_filters() To call the 'bp_get_activities_member_rss_link' hook
     2481     *
     2482     * @return string $link The member activity feed link
     2483     */
    14912484    function bp_get_member_activity_feed_link() {
    14922485        global $bp;
     
    15072500        return apply_filters( 'bp_get_activities_member_rss_link', $link );
    15082501    }
     2502
     2503    /**
     2504     * Returns the member activity feed link
     2505     *
     2506     * @since 1.0.0
     2507     * @deprecated 1.2.0
     2508     *
     2509     * @todo properly deprecated in favor of bp_get_member_activity_feed_link()
     2510     *
     2511     * @uses bp_get_member_activity_feed_link()
     2512     *
     2513     * @return string The member activity feed link
     2514     */
    15092515    function bp_get_activities_member_rss_link() { return bp_get_member_activity_feed_link(); }
    15102516
    15112517
    1512 /** Template tags for RSS feed output *****************************************/
    1513 
     2518/** Template tags for RSS feed output ****************************************/
     2519
     2520/**
     2521 * Outputs the activity feed item guid
     2522 *
     2523 * @since 1.0.0
     2524 *
     2525 * @uses bp_activity_feed_item_guid()
     2526 */
    15142527function bp_activity_feed_item_guid() {
    15152528    echo bp_get_activity_feed_item_guid();
    15162529}
     2530
     2531    /**
     2532     * Returns the activity feed item guid
     2533     *
     2534     * @since 1.2.0
     2535     *
     2536     * @global object $activities_template {@link BP_Activity_Template}
     2537     * @uses apply_filters() To call the 'bp_get_activity_feed_item_guid' hook
     2538     *
     2539     * @return string The activity feed item guid
     2540     */
    15172541    function bp_get_activity_feed_item_guid() {
    15182542        global $activities_template;
     
    15212545    }
    15222546
     2547/**
     2548 * Outputs the activity feed item title
     2549 *
     2550 * @since 1.0.0
     2551 *
     2552 * @uses bp_get_activity_feed_item_title()
     2553 */
    15232554function bp_activity_feed_item_title() {
    15242555    echo bp_get_activity_feed_item_title();
    15252556}
     2557
     2558    /**
     2559     * Returns the activity feed item title
     2560     *
     2561     * @since 1.0.0
     2562     *
     2563     * @global object $activities_template {@link BP_Activity_Template}
     2564     * @uses ent2ncr()
     2565     * @uses convert_chars()
     2566     * @uses bp_create_excerpt()
     2567     * @uses apply_filters() To call the 'bp_get_activity_feed_item_title' hook
     2568     *
     2569     * @return string $title The activity feed item title
     2570     */
    15262571    function bp_get_activity_feed_item_title() {
    15272572        global $activities_template;
     
    15442589    }
    15452590
     2591/**
     2592 * Outputs the activity feed item link
     2593 *
     2594 * @since 1.0.0
     2595 *
     2596 * @uses bp_get_activity_feed_item_link()
     2597 */
    15462598function bp_activity_feed_item_link() {
    15472599    echo bp_get_activity_feed_item_link();
    15482600}
     2601
     2602    /**
     2603     * Returns the activity feed item link
     2604     *
     2605     * @since 1.0.0
     2606     *
     2607     * @global object $activities_template {@link BP_Activity_Template}
     2608     * @uses apply_filters() To call the 'bp_get_activity_feed_item_link' hook
     2609     *
     2610     * @return string The activity feed item link
     2611     */
    15492612    function bp_get_activity_feed_item_link() {
    15502613        global $activities_template;
     
    15532616    }
    15542617
     2618/**
     2619 * Outputs the activity feed item date
     2620 *
     2621 * @since 1.0.0
     2622 *
     2623 * @uses bp_get_activity_feed_item_date()
     2624 */
    15552625function bp_activity_feed_item_date() {
    15562626    echo bp_get_activity_feed_item_date();
    15572627}
     2628
     2629    /**
     2630     * Returns the activity feed item date
     2631     *
     2632     * @since 1.0.0
     2633     *
     2634     * @global object $activities_template {@link BP_Activity_Template}
     2635     * @uses apply_filters() To call the 'bp_get_activity_feed_item_date' hook
     2636     *
     2637     * @return string The activity feed item date
     2638     */
    15582639    function bp_get_activity_feed_item_date() {
    15592640        global $activities_template;
     
    15622643    }
    15632644
     2645/**
     2646 * Outputs the activity feed item description
     2647 *
     2648 * @since 1.0.0
     2649 *
     2650 * @uses bp_get_activity_feed_item_description()
     2651 */
    15642652function bp_activity_feed_item_description() {
    15652653    echo bp_get_activity_feed_item_description();
    15662654}
     2655
     2656    /**
     2657     * Returns the activity feed item description
     2658     *
     2659     * @since 1.0.0
     2660     *
     2661     * @global object $activities_template {@link BP_Activity_Template}
     2662     * @uses ent2ncr()
     2663     * @uses convert_chars()
     2664     * @uses apply_filters() To call the 'bp_get_activity_feed_item_description' hook
     2665     *
     2666     * @return string The activity feed item description
     2667     */
    15672668    function bp_get_activity_feed_item_description() {
    15682669        global $activities_template;
     
    15792680 * Template tag so we can hook activity feed to <head>
    15802681 *
    1581  * @since 1.5
     2682 * @since 1.5.0
     2683 *
     2684 * @uses bloginfo()
     2685 * @uses bp_sitewide_activity_feed_link()
    15822686 */
    15832687function bp_activity_sitewide_feed() {
Note: See TracChangeset for help on using the changeset viewer.