Ticket #5938: bp-activity-template-5938.diff
File bp-activity-template-5938.diff, 74.2 KB (added by , 10 years ago) |
---|
-
src/bp-activity/bp-activity-template.php
13 13 /** 14 14 * Output the activity component slug. 15 15 * 16 * @since BuddyPress (1.5 )16 * @since BuddyPress (1.5.0) 17 17 * 18 18 * @uses bp_get_activity_slug() 19 19 */ … … 23 23 /** 24 24 * Return the activity component slug. 25 25 * 26 * @since BuddyPress (1.5 )26 * @since BuddyPress (1.5.0) 27 27 * 28 28 * @uses apply_filters() To call the 'bp_get_activity_slug' hook. 29 29 * … … 30 30 * @return string The activity component slug. 31 31 */ 32 32 function bp_get_activity_slug() { 33 34 /** 35 * Filters the activity component slug. 36 * 37 * @since BuddyPress (1.5.0) 38 * 39 * @param string $slug Activity component slug. 40 */ 33 41 return apply_filters( 'bp_get_activity_slug', buddypress()->activity->slug ); 34 42 } 35 43 … … 36 44 /** 37 45 * Output the activity component root slug. 38 46 * 39 * @since BuddyPress (1.5 )47 * @since BuddyPress (1.5.0) 40 48 * 41 49 * @uses bp_get_activity_root_slug() 42 50 */ … … 46 54 /** 47 55 * Return the activity component root slug. 48 56 * 49 * @since BuddyPress (1.5 )57 * @since BuddyPress (1.5.0) 50 58 * 51 59 * @uses apply_filters() To call the 'bp_get_activity_root_slug' hook. 52 60 * … … 53 61 * @return string The activity component root slug. 54 62 */ 55 63 function bp_get_activity_root_slug() { 64 65 /** 66 * Filters the activity component root slug. 67 * 68 * @since BuddyPress(1.5.0) 69 * 70 * @param string $root_slug Activity component root slug. 71 */ 56 72 return apply_filters( 'bp_get_activity_root_slug', buddypress()->activity->root_slug ); 57 73 } 58 74 … … 59 75 /** 60 76 * Output activity directory permalink. 61 77 * 62 * @since BuddyPress (1.5 )78 * @since BuddyPress (1.5.0) 63 79 * 64 80 * @uses bp_get_activity_directory_permalink() 65 81 */ … … 69 85 /** 70 86 * Return activity directory permalink 71 87 * 72 * @since BuddyPress (1.5 )88 * @since BuddyPress (1.5.0) 73 89 * 74 90 * @uses traisingslashit() 75 91 * @uses bp_get_root_domain() … … 79 95 * @return string Activity directory permalink. 80 96 */ 81 97 function bp_get_activity_directory_permalink() { 98 99 /** 100 * Filters the activity directory permalink. 101 * 102 * @since BuddyPress (1.5.0) 103 * 104 * @param string $url Permalink url for the activity directory. 105 */ 82 106 return apply_filters( 'bp_get_activity_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_activity_root_slug() ) ); 83 107 } 84 108 … … 87 111 * 88 112 * This is responsible for loading a group of activity items and displaying them. 89 113 * 90 * @since BuddyPress (1.0 )114 * @since BuddyPress (1.0.0) 91 115 */ 92 116 class BP_Activity_Template { 93 117 var $current_activity = -1; … … 340 364 if ( $this->current_activity + 1 < $this->activity_count ) { 341 365 return true; 342 366 } elseif ( $this->current_activity + 1 == $this->activity_count ) { 343 do_action('activity_loop_end'); 367 368 /** 369 * Fires right before the rewinding of activity posts. 370 * 371 * @since BuddyPress (1.1.0) 372 */ 373 do_action( 'activity_loop_end' ); 344 374 // Do some cleaning up after the loop 345 375 $this->rewind_activities(); 346 376 } … … 366 396 if ( is_array( $this->activity ) ) 367 397 $this->activity = (object) $this->activity; 368 398 369 if ( $this->current_activity == 0 ) // loop has just started 399 if ( $this->current_activity == 0 ) { // loop has just started 400 401 /** 402 * Fires if the current activity item is the first in the activity loop. 403 */ 370 404 do_action('activity_loop_start'); 405 } 371 406 } 372 407 } 373 408 … … 378 413 * $activities_template global, enabling the use of BuddyPress templates and 379 414 * template functions to display a list of activity items. 380 415 * 381 * @since BuddyPress (1.0 )416 * @since BuddyPress (1.0.0) 382 417 * 383 418 * @global object $activities_template {@link BP_Activity_Template} 384 419 * @global object $bp BuddyPress global settings. … … 657 692 if ( !empty( $max ) && ( (int) $per_page > (int) $max ) ) 658 693 $per_page = $max; 659 694 660 // Support for basic filters in earlier BP versions is disabled by default. To enable, put 661 // add_filter( 'bp_activity_enable_afilter_support', '__return_true' ); 662 // into bp-custom.php or your theme's functions.php 695 /** 696 * Filters whether BuddyPress should enable afilter support. 697 * 698 * Support for basic filters in earlier BP versions is disabled by default. 699 * To enable, put add_filter( 'bp_activity_enable_afilter_support', '__return_true' ); 700 * into bp-custom.php or your theme's functions.php. 701 * 702 * @since BuddyPress (1.6.0) 703 * 704 * @param bool false If BuddyPress should enable afilter support. 705 */ 663 706 if ( isset( $_GET['afilter'] ) && apply_filters( 'bp_activity_enable_afilter_support', false ) ) 664 707 $filter = array( 'object' => $_GET['afilter'] ); 665 708 else if ( ! empty( $user_id ) || ! empty( $object ) || ! empty( $action ) || ! empty( $primary_id ) || ! empty( $secondary_id ) || ! empty( $offset ) || ! empty( $since ) ) … … 692 735 693 736 $activities_template = new BP_Activity_Template( $template_args ); 694 737 738 /** 739 * Filters whether or not there are activity items to display. 740 * 741 * @since BuddyPress (1.1.0) 742 * 743 * @param bool $has_activities Whether or not there are activity items to display. 744 * @param string $activities_template Current activities template being used. 745 * @param array $template_args Array of arguments passed into the BP_Activity_Template class. 746 */ 695 747 return apply_filters( 'bp_has_activities', $activities_template->has_activities(), $activities_template, $template_args ); 696 748 } 697 749 … … 698 750 /** 699 751 * Determine if there are still activities left in the loop. 700 752 * 701 * @since BuddyPress (1.0 )753 * @since BuddyPress (1.0.0) 702 754 * 703 755 * @global object $activities_template {@link BP_Activity_Template} 704 756 * @uses BP_Activity_Template::user_activities() {@link BP_Activity_Template::user_activities()} … … 713 765 /** 714 766 * Get the current activity object in the loop. 715 767 * 716 * @since BuddyPress (1.0 )768 * @since BuddyPress (1.0.0) 717 769 * 718 770 * @global object $activities_template {@link BP_Activity_Template} 719 771 * @uses BP_Activity_Template::the_activity() {@link BP_Activity_Template::the_activity()} … … 739 791 $link = bp_get_requested_url(); 740 792 $link = add_query_arg( $activities_template->pag_arg, $activities_template->pag_page + 1, $link ); 741 793 794 /** 795 * Filters the Load More link url. 796 * 797 * @since BuddyPress (2.1.0) 798 * 799 * @param string $link The Load More link url. 800 */ 742 801 return apply_filters( 'bp_get_activity_load_more_link', $link ); 743 802 } 744 803 … … 745 804 /** 746 805 * Output the activity pagination count. 747 806 * 748 * @since BuddyPress (1.0 )807 * @since BuddyPress (1.0.0) 749 808 * 750 809 * @global object $activities_template {@link BP_Activity_Template} 751 810 * @uses BP_Activity_Template::the_activity() {@link BP_Activity_Template::the_activity()} … … 757 816 /** 758 817 * Return the activity pagination count. 759 818 * 760 * @since BuddyPress (1.2 )819 * @since BuddyPress (1.2.0) 761 820 * 762 821 * @global object $activities_template {@link BP_Activity_Template} 763 822 * @uses bp_core_number_format() … … 778 837 /** 779 838 * Output the activity pagination links. 780 839 * 781 * @since BuddyPress (1.0 )840 * @since BuddyPress (1.0.0) 782 841 * 783 842 * @uses bp_get_activity_pagination_links() 784 843 */ … … 789 848 /** 790 849 * Return the activity pagination links. 791 850 * 792 * @since BuddyPress (1.0 )851 * @since BuddyPress (1.0.0) 793 852 * 794 853 * @global object $activities_template {@link BP_Activity_Template} 795 854 * @uses apply_filters() To call the 'bp_get_activity_pagination_links' hook. … … 799 858 function bp_get_activity_pagination_links() { 800 859 global $activities_template; 801 860 861 /** 862 * Filters the activity pagination link output. 863 * 864 * @since BuddyPress (1.0.0) 865 * 866 * @param string $pag_links Output for the activity pagination links. 867 */ 802 868 return apply_filters( 'bp_get_activity_pagination_links', $activities_template->pag_links ); 803 869 } 804 870 … … 805 871 /** 806 872 * Return true when there are more activity items to be shown than currently appear. 807 873 * 808 * @since BuddyPress (1.5 )874 * @since BuddyPress (1.5.0) 809 875 * 810 876 * @global object $activities_template {@link BP_Activity_Template} 811 877 * @uses apply_filters() To call the 'bp_activity_has_more_items' hook. … … 827 893 $has_more_items = (int) $remaining_pages > 0; 828 894 } 829 895 896 /** 897 * Filters whether there are more activity items to display. 898 * 899 * @since BuddyPress (1.5.0) 900 * 901 * @param bool $has_more_items Whether or not there are more activity items to display. 902 */ 830 903 return apply_filters( 'bp_activity_has_more_items', $has_more_items ); 831 904 } 832 905 … … 833 906 /** 834 907 * Output the activity count. 835 908 * 836 * @since BuddyPress (1.2 )909 * @since BuddyPress (1.2.0) 837 910 * 838 911 * @uses bp_get_activity_count() 839 912 */ … … 844 917 /** 845 918 * Return the activity count. 846 919 * 847 * @since BuddyPress (1.2 )920 * @since BuddyPress (1.2.0) 848 921 * 849 922 * @global object $activities_template {@link BP_Activity_Template} 850 923 * @uses apply_filters() To call the 'bp_get_activity_count' hook. … … 854 927 function bp_get_activity_count() { 855 928 global $activities_template; 856 929 930 /** 931 * Filters the activity count for the activity template. 932 * 933 * @since BuddyPress (1.2.0) 934 * 935 * @param int $activity_count The count for total activity. 936 */ 857 937 return apply_filters( 'bp_get_activity_count', (int) $activities_template->activity_count ); 858 938 } 859 939 … … 860 940 /** 861 941 * Output the number of activities per page. 862 942 * 863 * @since BuddyPress (1.2 )943 * @since BuddyPress (1.2.0) 864 944 * 865 945 * @uses bp_get_activity_per_page() 866 946 */ … … 871 951 /** 872 952 * Return the number of activities per page. 873 953 * 874 * @since BuddyPress (1.2 )954 * @since BuddyPress (1.2.0) 875 955 * 876 956 * @global object $activities_template {@link BP_Activity_Template} 877 957 * @uses apply_filters() To call the 'bp_get_activity_per_page' hook. … … 881 961 function bp_get_activity_per_page() { 882 962 global $activities_template; 883 963 964 /** 965 * Filters the activity posts per page value. 966 * 967 * @since BuddyPress (1.2.0) 968 * 969 * @param int $pag_num How many post should be displayed for pagination. 970 */ 884 971 return apply_filters( 'bp_get_activity_per_page', (int) $activities_template->pag_num ); 885 972 } 886 973 … … 887 974 /** 888 975 * Output the activities title. 889 976 * 890 * @since BuddyPress (1.0 )977 * @since BuddyPress (1.0.0) 891 978 * 892 979 * @uses bp_get_activities_title() 893 980 * @todo Deprecate. … … 899 986 /** 900 987 * Return the activities title. 901 988 * 902 * @since BuddyPress (1.0 )989 * @since BuddyPress (1.0.0) 903 990 * 904 991 * @global string $bp_activity_title 905 992 * @uses apply_filters() To call the 'bp_get_activities_title' hook. 906 993 * @todo Deprecate. 907 994 * 908 * @return intThe activities title.995 * @return string The activities title. 909 996 */ 910 997 function bp_get_activities_title() { 911 998 global $bp_activity_title; 912 999 1000 /** 1001 * Filters the activities title for the activity template. 1002 * 1003 * @since BuddyPress (1.0.0) 1004 * 1005 * @param string $bp_activity_title The title to be displayed. 1006 */ 913 1007 return apply_filters( 'bp_get_activities_title', $bp_activity_title ); 914 1008 } 915 1009 … … 916 1010 /** 917 1011 * {@internal Missing Description} 918 1012 * 919 * @since BuddyPress (1.0 )1013 * @since BuddyPress (1.0.0) 920 1014 * 921 1015 * @uses bp_get_activities_no_activity() 922 1016 * @todo Deprecate. … … 928 1022 /** 929 1023 * {@internal Missing Description} 930 1024 * 931 * @since BuddyPress (1.0 )1025 * @since BuddyPress (1.0.0) 932 1026 * 933 1027 * @global string $bp_activity_no_activity 934 1028 * @uses apply_filters() To call the 'bp_get_activities_no_activity' hook … … 939 1033 function bp_get_activities_no_activity() { 940 1034 global $bp_activity_no_activity; 941 1035 1036 /** 1037 * Filters the text used when there is no activity to display. 1038 * 1039 * @since BuddyPress (1.0.0) 1040 * 1041 * @param string $bp_activity_no_activity Text to display for no activity. 1042 */ 942 1043 return apply_filters( 'bp_get_activities_no_activity', $bp_activity_no_activity ); 943 1044 } 944 1045 … … 945 1046 /** 946 1047 * Output the activity ID. 947 1048 * 948 * @since BuddyPress (1.2 )1049 * @since BuddyPress (1.2.0) 949 1050 * 950 1051 * @uses bp_get_activity_id() 951 1052 */ … … 956 1057 /** 957 1058 * Return the activity ID. 958 1059 * 959 * @since BuddyPress (1.2 )1060 * @since BuddyPress (1.2.0) 960 1061 * 961 1062 * @global object $activities_template {@link BP_Activity_Template} 962 1063 * @uses apply_filters() To call the 'bp_get_activity_id' hook. … … 965 1066 */ 966 1067 function bp_get_activity_id() { 967 1068 global $activities_template; 1069 1070 /** 1071 * Filters the activity ID being displayed. 1072 * 1073 * @since BuddyPress (1.2.0) 1074 * 1075 * @param int $id The activity ID. 1076 */ 968 1077 return apply_filters( 'bp_get_activity_id', $activities_template->activity->id ); 969 1078 } 970 1079 … … 971 1080 /** 972 1081 * Output the activity item ID. 973 1082 * 974 * @since BuddyPress (1.2 )1083 * @since BuddyPress (1.2.0) 975 1084 * 976 1085 * @uses bp_get_activity_item_id() 977 1086 */ … … 982 1091 /** 983 1092 * Return the activity item ID. 984 1093 * 985 * @since BuddyPress (1.2 )1094 * @since BuddyPress (1.2.0) 986 1095 * 987 1096 * @global object $activities_template {@link BP_Activity_Template} 988 1097 * @uses apply_filters() To call the 'bp_get_activity_item_id' hook. … … 991 1100 */ 992 1101 function bp_get_activity_item_id() { 993 1102 global $activities_template; 1103 1104 /** 1105 * Filters the activity item ID being displayed. 1106 * 1107 * @since BuddyPress (1.2.0) 1108 * 1109 * @param int $item_id The activity item ID. 1110 */ 994 1111 return apply_filters( 'bp_get_activity_item_id', $activities_template->activity->item_id ); 995 1112 } 996 1113 … … 997 1114 /** 998 1115 * Output the activity secondary item ID. 999 1116 * 1000 * @since BuddyPress (1.2 )1117 * @since BuddyPress (1.2.0) 1001 1118 * 1002 1119 * @uses bp_get_activity_secondary_item_id() 1003 1120 */ … … 1008 1125 /** 1009 1126 * Return the activity secondary item ID. 1010 1127 * 1011 * @since BuddyPress (1.2 )1128 * @since BuddyPress (1.2.0) 1012 1129 * 1013 1130 * @global object $activities_template {@link BP_Activity_Template} 1014 1131 * @uses apply_filters() To call the 'bp_get_activity_secondary_item_id' hook. … … 1017 1134 */ 1018 1135 function bp_get_activity_secondary_item_id() { 1019 1136 global $activities_template; 1137 1138 /** 1139 * Filters the activity secondary item ID being displayed. 1140 * 1141 * @since BuddyPress (1.2.0) 1142 * 1143 * @param int $secondary_item_id The activity secondary item ID. 1144 */ 1020 1145 return apply_filters( 'bp_get_activity_secondary_item_id', $activities_template->activity->secondary_item_id ); 1021 1146 } 1022 1147 … … 1023 1148 /** 1024 1149 * Output the date the activity was recorded. 1025 1150 * 1026 * @since BuddyPress (1.2 )1151 * @since BuddyPress (1.2.0) 1027 1152 * 1028 1153 * @uses bp_get_activity_date_recorded() 1029 1154 */ … … 1034 1159 /** 1035 1160 * Return the date the activity was recorded. 1036 1161 * 1037 * @since BuddyPress (1.2 )1162 * @since BuddyPress (1.2.0) 1038 1163 * 1039 1164 * @global object $activities_template {@link BP_Activity_Template} 1040 1165 * @uses apply_filters() To call the 'bp_get_activity_date_recorded' hook. … … 1043 1168 */ 1044 1169 function bp_get_activity_date_recorded() { 1045 1170 global $activities_template; 1171 1172 /** 1173 * Filters the date the activity was recorded. 1174 * 1175 * @since BuddyPress (1.2.0) 1176 * 1177 * @param int $date_recorded The activity's date. 1178 */ 1046 1179 return apply_filters( 'bp_get_activity_date_recorded', $activities_template->activity->date_recorded ); 1047 1180 } 1048 1181 … … 1074 1207 ? $activities_template->activity->display_name 1075 1208 : ''; 1076 1209 1210 /** 1211 * Filters the display name of the member who posted the activity. 1212 * 1213 * @since BuddyPress (2.1.0) 1214 * 1215 * @param int $retval Display name for the member who posted. 1216 */ 1077 1217 return apply_filters( 'bp_get_activity_member_display_name', $retval ); 1078 1218 } 1079 1219 … … 1080 1220 /** 1081 1221 * Output the activity object name. 1082 1222 * 1083 * @since BuddyPress (1.2 )1223 * @since BuddyPress (1.2.0) 1084 1224 * 1085 1225 * @uses bp_get_activity_object_name() 1086 1226 */ … … 1091 1231 /** 1092 1232 * Return the activity object name. 1093 1233 * 1094 * @since BuddyPress (1.2 )1234 * @since BuddyPress (1.2.0) 1095 1235 * 1096 1236 * @global object $activities_template {@link BP_Activity_Template} 1097 1237 * @uses apply_filters() To call the 'bp_get_activity_object_name' hook. … … 1100 1240 */ 1101 1241 function bp_get_activity_object_name() { 1102 1242 global $activities_template; 1243 1244 /** 1245 * Filters the activity object name. 1246 * 1247 * @since BuddyPress (1.2.0) 1248 * 1249 * @param string $activity_component The activity object name. 1250 */ 1103 1251 return apply_filters( 'bp_get_activity_object_name', $activities_template->activity->component ); 1104 1252 } 1105 1253 … … 1106 1254 /** 1107 1255 * Output the activity type. 1108 1256 * 1109 * @since BuddyPress (1.2 )1257 * @since BuddyPress (1.2.0) 1110 1258 * 1111 1259 * @uses bp_get_activity_type() 1112 1260 */ … … 1117 1265 /** 1118 1266 * Return the activity type. 1119 1267 * 1120 * @since BuddyPress (1.2 )1268 * @since BuddyPress (1.2.0) 1121 1269 * 1122 1270 * @global object $activities_template {@link BP_Activity_Template} 1123 1271 * @uses apply_filters() To call the 'bp_get_activity_type' hook. … … 1126 1274 */ 1127 1275 function bp_get_activity_type() { 1128 1276 global $activities_template; 1277 1278 /** 1279 * Filters the activity type. 1280 * 1281 * @since BuddyPress (1.2.0) 1282 * 1283 * @param string $activity_type The activity type. 1284 */ 1129 1285 return apply_filters( 'bp_get_activity_type', $activities_template->activity->type ); 1130 1286 } 1131 1287 … … 1134 1290 * 1135 1291 * Just a wrapper for bp_activity_type(). 1136 1292 * 1137 * @since BuddyPress (1.2 )1138 * @deprecated BuddyPress (1.5 )1293 * @since BuddyPress (1.2.0) 1294 * @deprecated BuddyPress (1.5.0) 1139 1295 * 1140 1296 * @todo Properly deprecate in favor of bp_activity_type() and 1141 1297 * remove redundant echo … … 1149 1305 * 1150 1306 * Just a wrapper for bp_get_activity_type(). 1151 1307 * 1152 * @since BuddyPress (1.2 )1153 * @deprecated BuddyPress (1.5 )1308 * @since BuddyPress (1.2.0) 1309 * @deprecated BuddyPress (1.5.0) 1154 1310 * 1155 1311 * @todo Properly deprecate in favor of bp_get_activity_type(). 1156 1312 * … … 1163 1319 /** 1164 1320 * Output the activity user ID. 1165 1321 * 1166 * @since BuddyPress (1.1 )1322 * @since BuddyPress (1.1.0) 1167 1323 * 1168 1324 * @uses bp_get_activity_user_id() 1169 1325 */ … … 1174 1330 /** 1175 1331 * Return the activity user ID. 1176 1332 * 1177 * @since BuddyPress (1.1 )1333 * @since BuddyPress (1.1.0) 1178 1334 * 1179 1335 * @global object $activities_template {@link BP_Activity_Template} 1180 1336 * @uses apply_filters() To call the 'bp_get_activity_user_id' hook. … … 1183 1339 */ 1184 1340 function bp_get_activity_user_id() { 1185 1341 global $activities_template; 1342 1343 /** 1344 * Filters the activity user ID. 1345 * 1346 * @since BuddyPress (1.1.0) 1347 * 1348 * @param int $user_id The activity user ID. 1349 */ 1186 1350 return apply_filters( 'bp_get_activity_user_id', $activities_template->activity->user_id ); 1187 1351 } 1188 1352 … … 1189 1353 /** 1190 1354 * Output the activity user link. 1191 1355 * 1192 * @since BuddyPress (1.2 )1356 * @since BuddyPress (1.2.0) 1193 1357 * 1194 1358 * @uses bp_get_activity_user_link() 1195 1359 */ … … 1200 1364 /** 1201 1365 * Return the activity user link. 1202 1366 * 1203 * @since BuddyPress (1.2 )1367 * @since BuddyPress (1.2.0) 1204 1368 * 1205 1369 * @global object $activities_template {@link BP_Activity_Template} 1206 1370 * @uses bp_core_get_user_domain() … … 1217 1381 $link = bp_core_get_user_domain( $activities_template->activity->user_id, $activities_template->activity->user_nicename, $activities_template->activity->user_login ); 1218 1382 } 1219 1383 1384 /** 1385 * Filters the activity user link. 1386 * 1387 * @since BuddyPress (1.2.0) 1388 * 1389 * @param string $link The activity user link. 1390 */ 1220 1391 return apply_filters( 'bp_get_activity_user_link', $link ); 1221 1392 } 1222 1393 … … 1223 1394 /** 1224 1395 * Output the avatar of the user that performed the action. 1225 1396 * 1226 * @since BuddyPress (1.1 )1397 * @since BuddyPress (1.1.0) 1227 1398 * 1228 1399 * @see bp_get_activity_avatar() for description of arguments. 1229 1400 * @uses bp_get_activity_avatar() … … 1236 1407 /** 1237 1408 * Return the avatar of the user that performed the action. 1238 1409 * 1239 * @since BuddyPress (1.1 )1410 * @since BuddyPress (1.1.0) 1240 1411 * 1241 1412 * @see bp_core_fetch_avatar() For a description of the arguments. 1242 1413 * @global object $activities_template {@link BP_Activity_Template} … … 1309 1480 } 1310 1481 } 1311 1482 1312 // Primary activity avatar is always a user, but can be modified via a filter 1483 /** 1484 * Filters the activity avatar object based on current activity item component. 1485 * 1486 * This is a variable filter dependent on the component used. Possible hooks are bp_get_activity_avatar_object_blog, bp_get_activity_avatar_object_group, and bp_get_activity_avatar_object_user. 1487 * 1488 * @since BuddyPress (1.1.0) 1489 * 1490 * @param string $component Component being displayed. 1491 */ 1313 1492 $object = apply_filters( 'bp_get_activity_avatar_object_' . $current_activity_item->component, 'user' ); 1314 1493 $item_id = !empty( $user_id ) ? $user_id : $current_activity_item->user_id; 1494 1495 /** 1496 * Filters the activity avatar item ID. 1497 * 1498 * @since BuddyPress (1.2.10) 1499 * 1500 * @param int $item_id Item ID for the activity avatar. 1501 */ 1315 1502 $item_id = apply_filters( 'bp_get_activity_avatar_item_id', $item_id ); 1316 1503 1317 1504 // If this is a user object pass the users' email address for Gravatar so we don't have to refetch it. … … 1318 1505 if ( 'user' == $object && empty( $user_id ) && empty( $email ) && isset( $current_activity_item->user_email ) ) 1319 1506 $email = $current_activity_item->user_email; 1320 1507 1508 /** 1509 * Filters the value returned by bp_core_fetch_avatar. 1510 * 1511 * @since BuddyPress (1.1.3) 1512 * 1513 * @param array $args Array of arguments calculated for use with bp_core_fetch_avatar. 1514 */ 1321 1515 return apply_filters( 'bp_get_activity_avatar', bp_core_fetch_avatar( array( 1322 1516 'item_id' => $item_id, 1323 1517 'object' => $object, … … 1333 1527 /** 1334 1528 * Output the avatar of the object that action was performed on. 1335 1529 * 1336 * @since BuddyPress (1.2 )1530 * @since BuddyPress (1.2.0) 1337 1531 * 1338 1532 * @see bp_get_activity_secondary_avatar() for description of arguments. 1339 1533 * @uses bp_get_activity_secondary_avatar() … … 1347 1541 /** 1348 1542 * Return the avatar of the object that action was performed on 1349 1543 * 1350 * @since BuddyPress (1.2 )1544 * @since BuddyPress (1.2.0) 1351 1545 * 1352 1546 * @see bp_core_fetch_avatar() for description of arguments. 1353 1547 * @global object $activities_template {@link BP_Activity_Template} … … 1446 1640 break; 1447 1641 } 1448 1642 1449 // Allow object, item_id, and link to be filtered 1643 /** 1644 * Filters the activity secondary avatar object based on current activity item component. 1645 * 1646 * This is a variable filter dependent on the component used. Possible hooks are bp_get_activity_secondary_avatar_object_blog, bp_get_activity_secondary_avatar_object_group, and bp_get_activity_secondary_avatar_object_user. 1647 * 1648 * @since BuddyPress (1.2.10) 1649 * 1650 * @param string $object Component being displayed. 1651 */ 1450 1652 $object = apply_filters( 'bp_get_activity_secondary_avatar_object_' . $activities_template->activity->component, $object ); 1653 1654 /** 1655 * Filters the activity secondary avatar item ID. 1656 * 1657 * @since BuddyPress (1.2.10) 1658 * 1659 * @param int $item_id ID for the secondary avatar item. 1660 */ 1451 1661 $item_id = apply_filters( 'bp_get_activity_secondary_avatar_item_id', $item_id ); 1452 1662 1453 1663 // If we have no item_id or object, there is no avatar to display … … 1468 1678 ) ); 1469 1679 1470 1680 if ( !empty( $linked ) ) { 1681 1682 /** 1683 * Filters the secondary avatar link for current activity. 1684 * 1685 * @since BuddyPress (1.7.0) 1686 * 1687 * @param string $link Link to wrap the avatar image in. 1688 * @param string $component Activity componant being acted on. 1689 */ 1471 1690 $link = apply_filters( 'bp_get_activity_secondary_avatar_link', $link, $activities_template->activity->component ); 1472 1691 1692 /** 1693 * Filters the determined avatar for the secondary activity item. 1694 * 1695 * @since BuddyPress (1.2.10) 1696 * 1697 * @param string Formatted HTML <img> element, or raw avatar URL. 1698 */ 1699 $avatar = apply_filters( 'bp_get_activity_secondary_avatar', $avatar ); 1700 1473 1701 return sprintf( '<a href="%s" class="%s">%s</a>', 1474 1702 $link, 1475 1703 $link_class, 1476 apply_filters( 'bp_get_activity_secondary_avatar', $avatar )1704 $avatar 1477 1705 ); 1478 1706 } 1479 1707 1480 / / else1708 /** This filter is documented in bp-activity/bp-activity-template.php */ 1481 1709 return apply_filters( 'bp_get_activity_secondary_avatar', $avatar ); 1482 1710 } 1483 1711 … … 1484 1712 /** 1485 1713 * Output the activity action 1486 1714 * 1487 * @since BuddyPress (1.2 )1715 * @since BuddyPress (1.2.0) 1488 1716 * 1489 1717 * @param array $args See bp_get_activity_action() 1490 1718 * @uses bp_get_activity_action() … … 1496 1724 /** 1497 1725 * Return the activity action 1498 1726 * 1499 * @since BuddyPress (1.2 )1727 * @since BuddyPress (1.2.0) 1500 1728 * 1501 1729 * @global object $activities_template {@link BP_Activity_Template} 1502 1730 * @param array $args Only parameter is "no_timestamp". If true, timestamp is shown in output. … … 1520 1748 extract( $args, EXTR_SKIP ); 1521 1749 1522 1750 $action = $activities_template->activity->action; 1751 1752 /** 1753 * Filters the activity action before the action is inserted as meta. 1754 * 1755 * @since BuddyPress (1.2.10) 1756 * 1757 * @param array $action Array containing the current action, the current activity, and the $args array passed into the function. 1758 */ 1523 1759 $action = apply_filters_ref_array( 'bp_get_activity_action_pre_meta', array( $action, &$activities_template->activity, $args ) ); 1524 1760 1525 1761 if ( ! empty( $action ) && ! $no_timestamp ) 1526 1762 $action = bp_insert_activity_meta( $action ); 1527 1763 1764 /** 1765 * Filters the activity action after the action has been inserted as meta. 1766 * 1767 * @since BuddyPress (1.2.0) 1768 * 1769 * @param array $action Array containing the current action, the current activity, and the $args array passed into the function. 1770 */ 1528 1771 return apply_filters_ref_array( 'bp_get_activity_action', array( $action, &$activities_template->activity, $args ) ); 1529 1772 } 1530 1773 … … 1531 1774 /** 1532 1775 * Output the activity content body 1533 1776 * 1534 * @since BuddyPress (1.2 )1777 * @since BuddyPress (1.2.0) 1535 1778 * 1536 1779 * @uses bp_get_activity_content_body() 1537 1780 */ … … 1542 1785 /** 1543 1786 * Return the activity content body 1544 1787 * 1545 * @since BuddyPress (1.2 )1788 * @since BuddyPress (1.2.0) 1546 1789 * 1547 1790 * @global object $activities_template {@link BP_Activity_Template} 1548 1791 * @uses bp_insert_activity_meta() … … 1557 1800 if ( empty( $activities_template->activity->action ) && !empty( $activities_template->activity->content ) ) 1558 1801 $activities_template->activity->content = bp_insert_activity_meta( $activities_template->activity->content ); 1559 1802 1803 /** 1804 * Filters the activity content body. 1805 * 1806 * @since BuddyPress (1.2.0) 1807 * 1808 * @param array $content Array containing the current activity content body and the current activity. 1809 */ 1560 1810 return apply_filters_ref_array( 'bp_get_activity_content_body', array( $activities_template->activity->content, &$activities_template->activity ) ); 1561 1811 } 1562 1812 … … 1563 1813 /** 1564 1814 * Does the activity have content? 1565 1815 * 1566 * @since BuddyPress (1.2 )1816 * @since BuddyPress (1.2.0) 1567 1817 * 1568 1818 * @global object $activities_template {@link BP_Activity_Template} 1569 1819 * … … 1581 1831 /** 1582 1832 * Output the activity content. 1583 1833 * 1584 * @since BuddyPress (1.0 )1585 * @deprecated BuddyPress (1.5 )1834 * @since BuddyPress (1.0.0) 1835 * @deprecated BuddyPress (1.5.0) 1586 1836 * 1587 1837 * @todo properly deprecate this function. 1588 1838 * … … 1595 1845 /** 1596 1846 * Return the activity content. 1597 1847 * 1598 * @since BuddyPress (1.0 )1599 * @deprecated BuddyPress (1.5 )1848 * @since BuddyPress (1.0.0) 1849 * @deprecated BuddyPress (1.5.0) 1600 1850 * 1601 1851 * @todo properly deprecate this function. 1602 1852 * … … 1607 1857 * @return string The activity content. 1608 1858 */ 1609 1859 function bp_get_activity_content() { 1860 1610 1861 /** 1611 1862 * If you want to filter activity update content, please use 1612 1863 * the filter 'bp_get_activity_content_body' … … 1613 1864 * 1614 1865 * This function is mainly for backwards comptibility. 1615 1866 */ 1616 1617 1867 $content = bp_get_activity_action() . ' ' . bp_get_activity_content_body(); 1618 1868 return apply_filters( 'bp_get_activity_content', $content ); 1619 1869 } … … 1624 1874 * This metadata includes the time since the item was posted (which will appear 1625 1875 * as a link to the item's permalink). 1626 1876 * 1627 * @since BuddyPress (1.2 )1877 * @since BuddyPress (1.2.0) 1628 1878 * 1629 1879 * @global object $activities_template {@link BP_Activity_Template} 1630 1880 * @uses bp_core_time_since() … … 1644 1894 // Strip any legacy time since placeholders from BP 1.0-1.1 1645 1895 $content = str_replace( '<span class="time-since">%s</span>', '', $content ); 1646 1896 1647 // Insert the time since. 1897 /** 1898 * Filters the activity item time since markup. 1899 * 1900 * @since BuddyPress (1.2.0) 1901 * 1902 * @param array $time_since acArray containing the time since markup and the current activity component. 1903 */ 1648 1904 $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 ) ); 1649 1905 1650 1906 // Insert the permalink 1651 if ( !bp_is_single_activity() ) 1907 if ( !bp_is_single_activity() ) { 1908 1909 /** 1910 * Filters the activity permalink to be added to the activity content. 1911 * 1912 * @since BuddyPress (1.2.0) 1913 * 1914 * @param array $permalink Array containing the html markup for the activity permalink, after being parsed by sprintf and current activity component. 1915 */ 1652 1916 $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 ) ); 1653 else1917 } else { 1654 1918 $content .= str_pad( $time_since, strlen( $time_since ) + 2, ' ', STR_PAD_BOTH ); 1919 } 1655 1920 1921 /** 1922 * Filters the activity content after activity metadata has been attached. 1923 * 1924 * @since BuddyPress (1.2.0) 1925 * 1926 * @param string $content Activity content with the activity metadata added. 1927 */ 1656 1928 return apply_filters( 'bp_insert_activity_meta', $content ); 1657 1929 } 1658 1930 … … 1659 1931 /** 1660 1932 * Determine if the current user can delete an activity item. 1661 1933 * 1662 * @since BuddyPress (1.2 )1934 * @since BuddyPress (1.2.0) 1663 1935 * 1664 1936 * @global object $activities_template {@link BP_Activity_Template} 1665 1937 * @uses apply_filters() To call the 'bp_activity_user_can_delete' hook … … 1704 1976 } 1705 1977 } 1706 1978 1979 /** 1980 * Filters whether the current user can delete an activity item. 1981 * 1982 * @since BuddyPress (1.5.0) 1983 * 1984 * @param bool $can_delete Whether the user can delete the item. 1985 * @param object $activity Current activity item object. 1986 */ 1707 1987 return (bool) apply_filters( 'bp_activity_user_can_delete', $can_delete, $activity ); 1708 1988 } 1709 1989 … … 1710 1990 /** 1711 1991 * Output the activity parent content. 1712 1992 * 1713 * @since BuddyPress (1.2 )1993 * @since BuddyPress (1.2.0) 1714 1994 * 1715 1995 * @see bp_get_activity_parent_content() for a description of arguments. 1716 1996 * @uses bp_get_activity_parent_content() … … 1724 2004 /** 1725 2005 * Return the activity content. 1726 2006 * 1727 * @since BuddyPress (1.2 )2007 * @since BuddyPress (1.2.0) 1728 2008 * 1729 2009 * @global object $activities_template {@link BP_Activity_Template} 1730 2010 * @uses wp_parse_args() … … 1771 2051 // Remove images 1772 2052 $content = preg_replace( '/<img[^>]*>/Ui', '', $content ); 1773 2053 2054 /** 2055 * Filters the activity parent content. 2056 * 2057 * @since BuddyPress (1.2.0) 2058 * 2059 * @param string $content Content set to be displayed as parent content. 2060 */ 1774 2061 return apply_filters( 'bp_get_activity_parent_content', $content ); 1775 2062 } 1776 2063 … … 1777 2064 /** 1778 2065 * Output the parent activity's user ID. 1779 2066 * 1780 * @since BuddyPress (1.7 )2067 * @since BuddyPress (1.7.0) 1781 2068 */ 1782 2069 function bp_activity_parent_user_id() { 1783 2070 echo bp_get_activity_parent_user_id(); … … 1786 2073 /** 1787 2074 * Return the parent activity's user ID. 1788 2075 * 1789 * @since BuddyPress (1.7 )2076 * @since BuddyPress (1.7.0) 1790 2077 * 1791 2078 * @global BP_Activity_Template $activities_template 1792 2079 * … … 1814 2101 1815 2102 $retval = $activities_template->activity_parents[$parent_id]->user_id; 1816 2103 2104 /** 2105 * Filters the activity parent item's user ID. 2106 * 2107 * @since BuddyPress (1.7.0) 2108 * 2109 * @param int $retval ID for the activity parent's user. 2110 */ 1817 2111 return (int) apply_filters( 'bp_get_activity_parent_user_id', $retval ); 1818 2112 } 1819 2113 … … 1820 2114 /** 1821 2115 * Output whether or not the current activity is in a current user's favorites. 1822 2116 * 1823 * @since BuddyPress (1.2 )2117 * @since BuddyPress (1.2.0) 1824 2118 * 1825 2119 * @uses bp_get_activity_is_favorite() 1826 2120 */ … … 1831 2125 /** 1832 2126 * Return whether the current activity is in a current user's favorites. 1833 2127 * 1834 * @since BuddyPress (1.2 )2128 * @since BuddyPress (1.2.0) 1835 2129 * 1836 2130 * @global object $activities_template {@link BP_Activity_Template} 1837 2131 * @uses apply_filters() To call the 'bp_get_activity_is_favorite' hook. … … 1841 2135 function bp_get_activity_is_favorite() { 1842 2136 global $activities_template; 1843 2137 2138 /** 2139 * Filters whether the current activity item is in the current user's favorites. 2140 * 2141 * @since BuddyPress (1.2.0) 2142 * 2143 * @param bool Whether or not the current activity item is in the current user's favorites. 2144 */ 1844 2145 return (bool) apply_filters( 'bp_get_activity_is_favorite', in_array( $activities_template->activity->id, (array) $activities_template->my_favs ) ); 1845 2146 } 1846 2147 … … 1847 2148 /** 1848 2149 * Output the comment markup for an activity item. 1849 2150 * 1850 * @since BuddyPress (1.2 )2151 * @since BuddyPress (1.2.0) 1851 2152 * 1852 2153 * @todo deprecate $args param 1853 2154 * … … 1860 2161 /** 1861 2162 * Get the comment markup for an activity item. 1862 2163 * 1863 * @since BuddyPress (1.2 )2164 * @since BuddyPress (1.2.0) 1864 2165 * 1865 2166 * @todo deprecate $args param 1866 2167 * … … 1887 2188 * Note: The recursion itself used to happen entirely in this function. Now it is 1888 2189 * split between here and the comment.php template. 1889 2190 * 1890 * @since BuddyPress (1.2 )2191 * @since BuddyPress (1.2.0) 1891 2192 * 1892 2193 * @param object $comment The activity object currently being recursed 1893 2194 * … … 1903 2204 if ( empty( $comment->children ) ) 1904 2205 return false; 1905 2206 2207 /** 2208 * Filters the opening tag for the template that lists activity comments. 2209 * 2210 * @since BuddyPress (1.6.0) 2211 * 2212 * @param string $tag Opening tag for the html markup to use. 2213 */ 1906 2214 echo apply_filters( 'bp_activity_recurse_comments_start_ul', '<ul>'); 1907 2215 foreach ( (array) $comment->children as $comment_child ) { 1908 2216 // Put the comment into the global so it's available to filters … … 1922 2230 1923 2231 unset( $activities_template->activity->current_comment ); 1924 2232 } 2233 2234 /** 2235 * Filters the closing tag for the template that list activity comments. 2236 * 2237 * @since BuddyPress (1.6.0) 2238 * 2239 * @param string $tag Closing tag for the html markup to use. 2240 */ 1925 2241 echo apply_filters( 'bp_activity_recurse_comments_end_ul', '</ul>'); 1926 2242 } 1927 2243 … … 1928 2244 /** 1929 2245 * Utility function that returns the comment currently being recursed. 1930 2246 * 1931 * @since BuddyPress (1.5 )2247 * @since BuddyPress (1.5.0) 1932 2248 * 1933 2249 * @global object $activities_template {@link BP_Activity_Template} 1934 2250 * @uses apply_filters() To call the 'bp_activity_current_comment' hook. … … 1941 2257 1942 2258 $current_comment = !empty( $activities_template->activity->current_comment ) ? $activities_template->activity->current_comment : false; 1943 2259 2260 /** 2261 * Filters the current comment being recursed. 2262 * 2263 * @since BuddyPress (1.5.0) 2264 * 2265 * @param object|bool $current_comment The activity comment currently being displayed. False on failure. 2266 */ 1944 2267 return apply_filters( 'bp_activity_current_comment', $current_comment ); 1945 2268 } 1946 2269 … … 1948 2271 /** 1949 2272 * Output the ID of the activity comment currently being displayed. 1950 2273 * 1951 * @since BuddyPress (1.5 )2274 * @since BuddyPress (1.5.0) 1952 2275 * 1953 2276 * @uses bp_get_activity_comment_id() 1954 2277 */ … … 1959 2282 /** 1960 2283 * Return the ID of the activity comment currently being displayed. 1961 2284 * 1962 * @since BuddyPress (1.5 )2285 * @since BuddyPress (1.5.0) 1963 2286 * 1964 2287 * @global object $activities_template {@link BP_Activity_Template} 1965 2288 * @uses apply_filters() To call the 'bp_activity_comment_id' hook. … … 1972 2295 1973 2296 $comment_id = isset( $activities_template->activity->current_comment->id ) ? $activities_template->activity->current_comment->id : false; 1974 2297 2298 /** 2299 * Filters the ID of the activity comment currently being displayed. 2300 * 2301 * @since BuddyPress (1.5.0) 2302 * 2303 * @param int|bool $comment_id ID for the comment currently being displayed. 2304 */ 1975 2305 return apply_filters( 'bp_activity_comment_id', $comment_id ); 1976 2306 } 1977 2307 … … 1978 2308 /** 1979 2309 * Output the ID of the author of the activity comment currently being displayed. 1980 2310 * 1981 * @since BuddyPress (1.5 )2311 * @since BuddyPress (1.5.0) 1982 2312 * 1983 2313 * @uses bp_get_activity_comment_user_id() 1984 2314 */ … … 1989 2319 /** 1990 2320 * Return the ID of the author of the activity comment currently being displayed. 1991 2321 * 1992 * @since BuddyPress (1.5 )2322 * @since BuddyPress (1.5.0) 1993 2323 * 1994 2324 * @global object $activities_template {@link BP_Activity_Template} 1995 2325 * @uses apply_filters() To call the 'bp_activity_comment_user_id' hook. … … 2002 2332 2003 2333 $user_id = isset( $activities_template->activity->current_comment->user_id ) ? $activities_template->activity->current_comment->user_id : false; 2004 2334 2335 /** 2336 * Filters the ID of the author of the activity comment currently being displayed. 2337 * 2338 * @since BuddyPress (1.5.0) 2339 * 2340 * @param int|bool $user_id ID for the author of the comment currently being displayed. 2341 */ 2005 2342 return apply_filters( 'bp_activity_comment_user_id', $user_id ); 2006 2343 } 2007 2344 … … 2008 2345 /** 2009 2346 * Output the author link for the activity comment currently being displayed. 2010 2347 * 2011 * @since BuddyPress (1.5 )2348 * @since BuddyPress (1.5.0) 2012 2349 * 2013 2350 * @uses bp_get_activity_comment_user_link() 2014 2351 */ … … 2019 2356 /** 2020 2357 * Return the author link for the activity comment currently being displayed. 2021 2358 * 2022 * @since BuddyPress (1.5 )2359 * @since BuddyPress (1.5.0) 2023 2360 * 2024 2361 * @uses bp_core_get_user_domain() 2025 2362 * @uses bp_get_activity_comment_user_id() … … 2030 2367 function bp_get_activity_comment_user_link() { 2031 2368 $user_link = bp_core_get_user_domain( bp_get_activity_comment_user_id() ); 2032 2369 2370 /** 2371 * Filters the author link for the activity comment currently being displayed. 2372 * 2373 * @since BuddyPress (1.5.0) 2374 * 2375 * @param string $user_link Link for the author of the activity comment currently being displayed. 2376 */ 2033 2377 return apply_filters( 'bp_activity_comment_user_link', $user_link ); 2034 2378 } 2035 2379 … … 2036 2380 /** 2037 2381 * Output the author name for the activity comment currently being displayed. 2038 2382 * 2039 * @since BuddyPress (1.5 )2383 * @since BuddyPress (1.5.0) 2040 2384 * 2041 2385 * @uses bp_get_activity_comment_name() 2042 2386 */ … … 2050 2394 * The use of the 'bp_acomment_name' filter is deprecated. Please use 2051 2395 * 'bp_activity_comment_name'. 2052 2396 * 2053 * @since BuddyPress (1.5 )2397 * @since BuddyPress (1.5.0) 2054 2398 * 2055 2399 * @global object $activities_template {@link BP_Activity_Template} 2056 2400 * @uses apply_filters() To call the 'bp_acomment_name' hook. … … 2061 2405 function bp_get_activity_comment_name() { 2062 2406 global $activities_template; 2063 2407 2064 if ( isset( $activities_template->activity->current_comment->user_fullname ) ) 2408 if ( isset( $activities_template->activity->current_comment->user_fullname ) ) { 2409 2065 2410 $name = apply_filters( 'bp_acomment_name', $activities_template->activity->current_comment->user_fullname, $activities_template->activity->current_comment ); // backward compatibility 2066 else2411 } else { 2067 2412 $name = $activities_template->activity->current_comment->display_name; 2413 } 2068 2414 2415 /** 2416 * Filters the name of the author for the activity comment. 2417 * 2418 * @since BuddyPress (1.5.0) 2419 * 2420 * @param string $name Name to be displayed with the activity comment. 2421 */ 2069 2422 return apply_filters( 'bp_activity_comment_name', $name ); 2070 2423 } 2071 2424 … … 2072 2425 /** 2073 2426 * Output the date_recorded of the activity comment currently being displayed. 2074 2427 * 2075 * @since BuddyPress (1.5 )2428 * @since BuddyPress (1.5.0) 2076 2429 * 2077 2430 * @uses bp_get_activity_comment_date_recorded() 2078 2431 */ … … 2083 2436 /** 2084 2437 * Return the date_recorded for the activity comment currently being displayed. 2085 2438 * 2086 * @since BuddyPress (1.5 )2439 * @since BuddyPress (1.5.0) 2087 2440 * 2088 2441 * @global object $activities_template {@link BP_Activity_Template} 2089 2442 * @uses bp_core_time_since() … … 2100 2453 2101 2454 $date_recorded = bp_core_time_since( $activities_template->activity->current_comment->date_recorded ); 2102 2455 2456 /** 2457 * Filters the recorded date of the activity comment currently being displayed. 2458 * 2459 * @since BuddyPress (1.5.0) 2460 * 2461 * @param string|bool Date for the activity comment currently being displayed. 2462 */ 2103 2463 return apply_filters( 'bp_activity_comment_date_recorded', $date_recorded ); 2104 2464 } 2105 2465 … … 2106 2466 /** 2107 2467 * Output the 'delete' URL for the activity comment currently being displayed. 2108 2468 * 2109 * @since BuddyPress (1.5 )2469 * @since BuddyPress (1.5.0) 2110 2470 * 2111 2471 * @uses bp_get_activity_comment_delete_link() 2112 2472 */ … … 2117 2477 /** 2118 2478 * Gets the 'delete' URL for the activity comment currently being displayed 2119 2479 * 2120 * @since BuddyPress (1.5 )2480 * @since BuddyPress (1.5.0) 2121 2481 * 2122 2482 * @uses wp_nonce_url() 2123 2483 * @uses bp_get_root_domain() … … 2131 2491 function bp_get_activity_comment_delete_link() { 2132 2492 $link = wp_nonce_url( bp_get_root_domain() . '/' . bp_get_activity_slug() . '/delete/' . bp_get_activity_comment_id() . '?cid=' . bp_get_activity_comment_id(), 'bp_activity_delete_link' ); 2133 2493 2494 /** 2495 * Filters the link used for deleting the activity comment currently being displayed. 2496 * 2497 * @since BuddyPress (1.5.0) 2498 * 2499 * @param string $link Link to use for deleting the currently displayed activity comment. 2500 */ 2134 2501 return apply_filters( 'bp_activity_comment_delete_link', $link ); 2135 2502 } 2136 2503 … … 2137 2504 /** 2138 2505 * Output the content of the activity comment currently being displayed. 2139 2506 * 2140 * @since BuddyPress (1.5 )2507 * @since BuddyPress (1.5.0) 2141 2508 * 2142 2509 * @uses bp_get_activity_comment_content() 2143 2510 */ … … 2153 2520 * 'bp_activity_comment_content' to modify the content of activity 2154 2521 * comments only. 2155 2522 * 2156 * @since BuddyPress (1.5 )2523 * @since BuddyPress (1.5.0) 2157 2524 * 2158 2525 * @global object $activities_template {@link BP_Activity_Template} 2159 2526 * @uses apply_filters() To call the 'bp_get_activity_content' hook. … … 2164 2531 function bp_get_activity_comment_content() { 2165 2532 global $activities_template; 2166 2533 2534 /** This filter is documented in bp-activity/bp-activity-template.php */ 2167 2535 $content = apply_filters( 'bp_get_activity_content', $activities_template->activity->current_comment->content ); 2168 2536 2537 /** 2538 * Filters the content of the current activity comment. 2539 * 2540 * @since BuddyPress (1.2.0) 2541 * 2542 * @param string $content The content of the current activity comment. 2543 */ 2169 2544 return apply_filters( 'bp_activity_comment_content', $content ); 2170 2545 } 2171 2546 … … 2172 2547 /** 2173 2548 * Output the activity comment count. 2174 2549 * 2175 * @since BuddyPress (1.2 )2550 * @since BuddyPress (1.2.0) 2176 2551 * 2177 2552 * @uses bp_activity_get_comment_count() 2178 2553 */ … … 2183 2558 /** 2184 2559 * Return the comment count of an activity item. 2185 2560 * 2186 * @since BuddyPress (1.2 )2561 * @since BuddyPress (1.2.0) 2187 2562 * 2188 2563 * @global object $activities_template {@link BP_Activity_Template} 2189 2564 * @uses bp_activity_recurse_comment_count() … … 2206 2581 ? bp_activity_recurse_comment_count( $activities_template->activity ) 2207 2582 : 0; 2208 2583 2584 /** 2585 * Filters the activity comment count. 2586 * 2587 * @since BuddyPress (1.2.0) 2588 * 2589 * @param int $count The activity comment count. 2590 */ 2209 2591 return apply_filters( 'bp_activity_get_comment_count', (int) $count ); 2210 2592 } 2211 2593 … … 2215 2597 * This function recursively adds the total number of comments each 2216 2598 * activity child has, and returns them. 2217 2599 * 2218 * @since BuddyPress (1.2 )2600 * @since BuddyPress (1.2.0) 2219 2601 * 2220 2602 * @uses bp_activity_recurse_comment_count() 2221 2603 * @uses apply_filters() To call the 'bp_activity_recurse_comment_count' hook … … 2238 2620 } 2239 2621 } 2240 2622 2241 // Filter and return 2623 /** 2624 * Filters the total number of comments for the current comment. 2625 * 2626 * @since BuddyPress (2.1.0) 2627 * 2628 * @param int $new_count New total count for the current comment. 2629 * @param object $comment Activity comment object. 2630 * @param int $count Current iteration count for the current comment. 2631 */ 2242 2632 return apply_filters( 'bp_activity_recurse_comment_count', $new_count, $comment, $count ); 2243 2633 } 2244 2634 … … 2255 2645 * 2256 2646 * @since BuddyPress (2.0.0) 2257 2647 * 2258 * @return int 2648 * @return int $depth Depth for the current activity comment 2259 2649 */ 2260 2650 function bp_activity_get_comment_depth() { 2261 2651 global $activities_template; 2652 2653 /** 2654 * Filters the comment depth of the current activity comment. 2655 * 2656 * @since BuddyPress (2.0.0) 2657 * 2658 * @param int $depth Depth for the current activity comment. 2659 */ 2262 2660 return apply_filters( 'bp_activity_get_comment_depth', $activities_template->activity->current_comment->depth ); 2263 2661 } 2264 2662 … … 2265 2663 /** 2266 2664 * Output the activity comment link. 2267 2665 * 2268 * @since BuddyPress (1.2 )2666 * @since BuddyPress (1.2.0) 2269 2667 * 2270 2668 * @uses bp_get_activity_comment_link() 2271 2669 */ … … 2276 2674 /** 2277 2675 * Return the activity comment link. 2278 2676 * 2279 * @since BuddyPress (1.2 )2677 * @since BuddyPress (1.2.0) 2280 2678 * 2281 2679 * @global object $activities_template {@link BP_Activity_Template} 2282 2680 * @uses apply_filters() To call the 'bp_get_activity_comment_link' hook. … … 2285 2683 */ 2286 2684 function bp_get_activity_comment_link() { 2287 2685 global $activities_template; 2686 2687 /** 2688 * Filters the comment link for the current activity comment. 2689 * 2690 * @since BuddyPress (1.2.0) 2691 * 2692 * @param string $url Constructed URL parameters with activity IDs. 2693 */ 2288 2694 return apply_filters( 'bp_get_activity_comment_link', '?ac=' . $activities_template->activity->id . '/#ac-form-' . $activities_template->activity->id ); 2289 2695 } 2290 2696 … … 2291 2697 /** 2292 2698 * Output the activity comment form no javascript display CSS. 2293 2699 * 2294 * @since BuddyPress (1.2 )2700 * @since BuddyPress (1.2.0) 2295 2701 * 2296 2702 * @uses bp_get_activity_comment_form_nojs_display() 2297 2703 */ … … 2302 2708 /** 2303 2709 * Return the activity comment form no javascript display CSS. 2304 2710 * 2305 * @since BuddyPress (1.2 )2711 * @since BuddyPress (1.2.0) 2306 2712 * 2307 2713 * @global object $activities_template {@link BP_Activity_Template} 2308 2714 * … … 2320 2726 /** 2321 2727 * Output the activity comment form action. 2322 2728 * 2323 * @since BuddyPress (1.2 )2729 * @since BuddyPress (1.2.0) 2324 2730 * 2325 2731 * @uses bp_get_activity_comment_form_action() 2326 2732 */ … … 2331 2737 /** 2332 2738 * Return the activity comment form action. 2333 2739 * 2334 * @since BuddyPress (1.2 )2740 * @since BuddyPress (1.2.0) 2335 2741 * 2336 2742 * @uses home_url() 2337 2743 * @uses bp_get_activity_root_slug() … … 2340 2746 * @return string The activity comment form action. 2341 2747 */ 2342 2748 function bp_get_activity_comment_form_action() { 2749 2750 /** 2751 * Filters the activity comment form action url. 2752 * 2753 * @since BuddyPress (1.2.0) 2754 * 2755 * @param string $action URL to use in the comment form's action attribute. 2756 */ 2343 2757 return apply_filters( 'bp_get_activity_comment_form_action', home_url( bp_get_activity_root_slug() . '/reply/' ) ); 2344 2758 } 2345 2759 … … 2346 2760 /** 2347 2761 * Output the activity permalink ID. 2348 2762 * 2349 * @since BuddyPress (1.2 )2763 * @since BuddyPress (1.2.0) 2350 2764 * 2351 2765 * @uses bp_get_activity_permalink_id() 2352 2766 */ … … 2357 2771 /** 2358 2772 * Return the activity permalink ID. 2359 2773 * 2360 * @since BuddyPress (1.2 )2774 * @since BuddyPress (1.2.0) 2361 2775 * 2362 2776 * @uses apply_filters() To call the 'bp_get_activity_permalink_id' hook. 2363 2777 * … … 2364 2778 * @return string The activity permalink ID. 2365 2779 */ 2366 2780 function bp_get_activity_permalink_id() { 2781 2782 /** 2783 * Filters the activity action permalink ID. 2784 * 2785 * @since BuddyPress (1.2.0) 2786 * 2787 * @param string $action Current action for the activity item. 2788 */ 2367 2789 return apply_filters( 'bp_get_activity_permalink_id', bp_current_action() ); 2368 2790 } 2369 2791 … … 2370 2792 /** 2371 2793 * Output the activity thread permalink. 2372 2794 * 2373 * @since BuddyPress (1.2 )2795 * @since BuddyPress (1.2.0) 2374 2796 * 2375 2797 * @uses bp_get_activity_permalink_id() 2376 2798 */ … … 2381 2803 /** 2382 2804 * Return the activity thread permalink. 2383 2805 * 2384 * @since BuddyPress (1.2 )2806 * @since BuddyPress (1.2.0) 2385 2807 * 2386 2808 * @uses bp_activity_get_permalink() 2387 2809 * @uses apply_filters() To call the 'bp_get_activity_thread_permalink' hook. … … 2393 2815 2394 2816 $link = bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ); 2395 2817 2818 /** 2819 * Filters the activity thread permalink. 2820 * 2821 * @since BuddyPress (1.2.0) 2822 * 2823 * @param string $link The activity thread permalink. 2824 */ 2396 2825 return apply_filters( 'bp_get_activity_thread_permalink', $link ); 2397 2826 } 2398 2827 … … 2399 2828 /** 2400 2829 * Output the activity comment permalink. 2401 2830 * 2402 * @since BuddyPress (1.8 )2831 * @since BuddyPress (1.8.0) 2403 2832 * 2404 2833 * @uses bp_get_activity_permalink_id() 2405 2834 */ … … 2409 2838 /** 2410 2839 * Return the activity comment permalink. 2411 2840 * 2412 * @since BuddyPress (1.8 )2841 * @since BuddyPress (1.8.0) 2413 2842 * 2414 2843 * @uses bp_activity_get_permalink() 2415 2844 * @uses apply_filters() To call the 'bp_get_activity_comment_permalink' hook. … … 2432 2861 // Append comment ID to end of activity permalink 2433 2862 $link = bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ) . $comment_link; 2434 2863 2864 /** 2865 * Filters the activity comment permalink. 2866 * 2867 * @since BuddyPress (1.8.0) 2868 * 2869 * @param string $link Activity comment permalink. 2870 * @param int $comment_id ID for the current activity comment. 2871 */ 2435 2872 return apply_filters( 'bp_get_activity_comment_permalink', $link, $comment_id ); 2436 2873 } 2437 2874 … … 2438 2875 /** 2439 2876 * Output the activity favorite link. 2440 2877 * 2441 * @since BuddyPress (1.2 )2878 * @since BuddyPress (1.2.0) 2442 2879 * 2443 2880 * @uses bp_get_activity_favorite_link() 2444 2881 */ … … 2449 2886 /** 2450 2887 * Return the activity favorite link. 2451 2888 * 2452 * @since BuddyPress (1.2 )2889 * @since BuddyPress (1.2.0) 2453 2890 * 2454 2891 * @global object $activities_template {@link BP_Activity_Template} 2455 2892 * @uses wp_nonce_url() … … 2461 2898 */ 2462 2899 function bp_get_activity_favorite_link() { 2463 2900 global $activities_template; 2901 2902 /** 2903 * Filters the activity favorite link. 2904 * 2905 * @since BuddyPress (1.2.0) 2906 * 2907 * @param string $favorite_link Constructed link for favoriting the activity comment. 2908 */ 2464 2909 return apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( home_url( bp_get_activity_root_slug() . '/favorite/' . $activities_template->activity->id . '/' ), 'mark_favorite' ) ); 2465 2910 } 2466 2911 … … 2467 2912 /** 2468 2913 * Output the activity unfavorite link. 2469 2914 * 2470 * @since BuddyPress (1.2 )2915 * @since BuddyPress (1.2.0) 2471 2916 * 2472 2917 * @uses bp_get_activity_unfavorite_link() 2473 2918 */ … … 2478 2923 /** 2479 2924 * Return the activity unfavorite link. 2480 2925 * 2481 * @since BuddyPress (1.2 )2926 * @since BuddyPress (1.2.0) 2482 2927 * 2483 2928 * @global object $activities_template {@link BP_Activity_Template} 2484 2929 * @uses wp_nonce_url() … … 2490 2935 */ 2491 2936 function bp_get_activity_unfavorite_link() { 2492 2937 global $activities_template; 2938 2939 /** 2940 * Filters the activity unfavorite link. 2941 * 2942 * @since BuddyPress (1.2.0) 2943 * 2944 * @param string $unfavorite_link Constructed link for unfavoriting the activity comment. 2945 */ 2493 2946 return apply_filters( 'bp_get_activity_unfavorite_link', wp_nonce_url( home_url( bp_get_activity_root_slug() . '/unfavorite/' . $activities_template->activity->id . '/' ), 'unmark_favorite' ) ); 2494 2947 } 2495 2948 … … 2496 2949 /** 2497 2950 * Output the activity CSS class. 2498 2951 * 2499 * @since BuddyPress (1.0 )2952 * @since BuddyPress (1.0.0) 2500 2953 * 2501 2954 * @uses bp_get_activity_css_class() 2502 2955 */ … … 2507 2960 /** 2508 2961 * Return the current activity item's CSS class. 2509 2962 * 2510 * @since BuddyPress (1.0 )2963 * @since BuddyPress (1.0.0) 2511 2964 * 2512 2965 * @global object $activities_template {@link BP_Activity_Template} 2513 2966 * @uses apply_filters() To call the 'bp_activity_mini_activity_types' hook. … … 2520 2973 function bp_get_activity_css_class() { 2521 2974 global $activities_template; 2522 2975 2976 /** 2977 * Filters the available mini activity actions available as css classes. 2978 * 2979 * @since BuddyPress (1.2.0) 2980 * 2981 * @param array $classes Array of classes used to determine classes applied to HTML element. 2982 */ 2523 2983 $mini_activity_actions = apply_filters( 'bp_activity_mini_activity_types', array( 2524 2984 'friendship_accepted', 2525 2985 'friendship_created', … … 2537 2997 if ( bp_activity_get_comment_count() && bp_activity_can_comment() ) 2538 2998 $class .= ' has-comments'; 2539 2999 3000 /** 3001 * Filters the determined classes to add to the HTML element. 3002 * 3003 * @since BuddyPress (1.0.0) 3004 * 3005 * @param string $classes Classes to be added to the HTML element. 3006 */ 2540 3007 return apply_filters( 'bp_get_activity_css_class', $activities_template->activity->component . ' ' . $activities_template->activity->type . $class ); 2541 3008 } 2542 3009 … … 2543 3010 /** 2544 3011 * Output the activity delete link. 2545 3012 * 2546 * @since BuddyPress (1.1 )3013 * @since BuddyPress (1.1.0) 2547 3014 * 2548 3015 * @uses bp_get_activity_delete_link() 2549 3016 */ … … 2554 3021 /** 2555 3022 * Return the activity delete link. 2556 3023 * 2557 * @since BuddyPress (1.1 )3024 * @since BuddyPress (1.1.0) 2558 3025 * 2559 3026 * @global object $activities_template {@link BP_Activity_Template} 2560 3027 * @uses bp_get_root_domain() … … 2581 3048 2582 3049 $link = '<a href="' . esc_url( $url ) . '" class="button item-button bp-secondary-action ' . $class . ' confirm" rel="nofollow">' . __( 'Delete', 'buddypress' ) . '</a>'; 2583 3050 3051 /** 3052 * Filters the activity delete link. 3053 * 3054 * @since BuddyPress (1.1.0) 3055 * 3056 * @param string $link Activity delete HTML link. 3057 */ 2584 3058 return apply_filters( 'bp_get_activity_delete_link', $link ); 2585 3059 } 2586 3060 … … 2624 3098 2625 3099 $url = wp_nonce_url( $url, 'bp_activity_delete_link' ); 2626 3100 3101 /** 3102 * Filters the activity delete URL. 3103 * 3104 * @since BuddyPress (2.1.0) 3105 * 3106 * @param string $url Activity delete URL. 3107 */ 2627 3108 return apply_filters( 'bp_get_activity_delete_url', $url ); 2628 3109 } 2629 3110 … … 2630 3111 /** 2631 3112 * Output the activity latest update link. 2632 3113 * 2633 * @since BuddyPress (1.2 )3114 * @since BuddyPress (1.2.0) 2634 3115 * 2635 3116 * @see bp_get_activity_latest_update() for description of parameters. 2636 3117 * @uses bp_get_activity_latest_update() … … 2644 3125 /** 2645 3126 * Return the activity latest update link. 2646 3127 * 2647 * @since BuddyPress (1.2 )3128 * @since BuddyPress (1.2.0) 2648 3129 * 2649 3130 * @uses bp_is_user_inactive() 2650 3131 * @uses bp_core_is_user_deleted() … … 2670 3151 if ( !$update = bp_get_user_meta( $user_id, 'bp_latest_update', true ) ) 2671 3152 return false; 2672 3153 3154 /** 3155 * Filters the latest update excerpt. 3156 * 3157 * @since BuddyPress (1.2.10) 3158 * 3159 * @param string $excerpt The excerpt for the latest update. 3160 */ 2673 3161 $latest_update = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], 358 ) ) ) ); 2674 3162 2675 3163 $latest_update = sprintf( … … 2679 3167 esc_attr__( 'View', 'buddypress' ) 2680 3168 ); 2681 3169 3170 /** 3171 * Filters the latest update excerpt with view link appended to the end. 3172 * 3173 * @since BuddyPress (1.2.0) 3174 * 3175 * @param string $latest_update The latest update with "view" link appended to it. 3176 */ 2682 3177 return apply_filters( 'bp_get_activity_latest_update', $latest_update ); 2683 3178 } 2684 3179 … … 2685 3180 /** 2686 3181 * Output the activity filter links. 2687 3182 * 2688 * @since BuddyPress (1.1 )3183 * @since BuddyPress (1.1.0) 2689 3184 * 2690 3185 * @see bp_get_activity_filter_links() for description of parameters. 2691 3186 * @uses bp_get_activity_filter_links() … … 2699 3194 /** 2700 3195 * Return the activity filter links. 2701 3196 * 2702 * @since BuddyPress (1.1 )3197 * @since BuddyPress (1.1.0) 2703 3198 * 2704 3199 * @uses wp_parse_args() 2705 3200 * @uses BP_Activity_Activity::get_recorded_components() {@link BP_Activity_Activity} … … 2767 3262 2768 3263 $link = add_query_arg( 'afilter', $component ); 2769 3264 $link = remove_query_arg( 'acpage' , $link ); 3265 3266 /** 3267 * Filters the activity filter link url for the current activity component. 3268 * 3269 * @since BuddyPress (1.1.0) 3270 * 3271 * @param string $link The URL for the current component. 3272 * @param string $component The current component getting links constructed for. 3273 */ 2770 3274 $link = apply_filters( 'bp_get_activity_filter_link_href', $link, $component ); 2771 3275 2772 3276 $component_links[] = $before . '<a href="' . esc_attr( $link ) . '">' . ucwords( $component ) . '</a>' . $after; … … 2777 3281 if ( isset( $_GET['afilter'] ) ) 2778 3282 $component_links[] = '<' . $tag . ' id="afilter-clear"><a href="' . esc_attr( $link ) . '">' . __( 'Clear Filter', 'buddypress' ) . '</a></' . $tag . '>'; 2779 3283 3284 /** 3285 * Filters all of the constructed filter links. 3286 * 3287 * @since BuddyPress (1.1.0) 3288 * 3289 * @param string $links All of the links to be displayed to the user. 3290 */ 2780 3291 return apply_filters( 'bp_get_activity_filter_links', implode( "\n", $component_links ) ); 2781 3292 } 2782 3293 … … 2783 3294 /** 2784 3295 * Determine if a comment can be made on an activity item. 2785 3296 * 2786 * @since BuddyPress (1.2 )3297 * @since BuddyPress (1.2.0) 2787 3298 * 2788 3299 * @global object $activities_template {@link BP_Activity_Template} 2789 3300 * @uses bp_get_activity_action_name() … … 2817 3328 break; 2818 3329 } 2819 3330 3331 /** 3332 * Filters whether a comment can be made on an activity item. 3333 * 3334 * @since BuddyPress (1.5.0) 3335 * 3336 * @param bool $can_comment Status on if activity can be commented on. 3337 * @param string $activity_action Current activity action being checked on. 3338 */ 2820 3339 return apply_filters( 'bp_activity_can_comment', $can_comment, $activity_action ); 2821 3340 } 2822 3341 … … 2856 3375 } 2857 3376 } 2858 3377 3378 /** 3379 * Filters whether a comment can be made on an activity reply item. 3380 * 3381 * @since BuddyPress (1.5.0) 3382 * 3383 * @param bool $can_comment Status on if activity reply can be commented on. 3384 * @param string $comment Current comment being checked on. 3385 */ 2859 3386 return (bool) apply_filters( 'bp_activity_can_comment_reply', $can_comment, $comment ); 2860 3387 } 2861 3388 2862 3389 /** 2863 * Determine if anfavorites are allowed.3390 * Determine if favorites are allowed. 2864 3391 * 2865 3392 * Defaults to true, but can be modified by plugins. 2866 3393 * 2867 * @since BuddyPress (1.5 )3394 * @since BuddyPress (1.5.0) 2868 3395 * 2869 3396 * @uses apply_filters() To call the 'bp_activity_can_favorite' hook. 2870 3397 * … … 2871 3398 * @return bool True if comment can receive comments. 2872 3399 */ 2873 3400 function bp_activity_can_favorite() { 3401 3402 /** 3403 * Filters whether or not users can favorite activity items. 3404 * 3405 * @since BuddyPress (1.5.0) 3406 * 3407 * @param bool $can_favorite Whether or not users can currently favorite. 3408 */ 2874 3409 return apply_filters( 'bp_activity_can_favorite', true ); 2875 3410 } 2876 3411 … … 2877 3412 /** 2878 3413 * Output the total favorite count for a specified user. 2879 3414 * 2880 * @since BuddyPress (1.2 )3415 * @since BuddyPress (1.2.0) 2881 3416 * 2882 3417 * @see bp_get_total_favorite_count_for_user() for description of parameters. 2883 3418 * @uses bp_get_total_favorite_count_for_user() … … 2891 3426 /** 2892 3427 * Return the total favorite count for a specified user. 2893 3428 * 2894 * @since BuddyPress (1.2 )3429 * @since BuddyPress (1.2.0) 2895 3430 * 2896 3431 * @uses bp_activity_total_favorites_for_user() 2897 3432 * @uses apply_filters() To call the 'bp_get_total_favorite_count_for_user' hook … … 2911 3446 ? bp_activity_total_favorites_for_user( $user_id ) 2912 3447 : false; 2913 3448 3449 /** 3450 * Filters the total favorite count for a user. 3451 * 3452 * @since BuddyPress (1.2.0) 3453 * 3454 * @param int|bool $retval Total favorite count for a user. False on no favorites. 3455 */ 2914 3456 return apply_filters( 'bp_get_total_favorite_count_for_user', $retval ); 2915 3457 } 2916 3458 … … 2918 3460 /** 2919 3461 * Output the total mention count for a specified user. 2920 3462 * 2921 * @since BuddyPress (1.2 )3463 * @since BuddyPress (1.2.0) 2922 3464 * 2923 3465 * @see bp_get_total_mention_count_for_user() for description of parameters. 2924 3466 * @uses bp_get_total_favorite_count_for_user() … … 2932 3474 /** 2933 3475 * Return the total mention count for a specified user. 2934 3476 * 2935 * @since BuddyPress (1.2 )3477 * @since BuddyPress (1.2.0) 2936 3478 * 2937 3479 * @uses bp_get_user_meta() 2938 3480 * @uses apply_filters() To call the 'bp_get_total_mention_count_for_user' hook. … … 2952 3494 ? bp_get_user_meta( $user_id, 'bp_new_mention_count', true ) 2953 3495 : false; 2954 3496 3497 /** 3498 * Filters the total mention count for a user. 3499 * 3500 * @since BuddyPress (1.2.0) 3501 * 3502 * @param int|bool $retval Total mention count for a user. False on no mentions. 3503 */ 2955 3504 return apply_filters( 'bp_get_total_mention_count_for_user', $retval ); 2956 3505 } 2957 3506 … … 2958 3507 /** 2959 3508 * Output the public message link for displayed user. 2960 3509 * 2961 * @since BuddyPress (1.2 )3510 * @since BuddyPress (1.2.0) 2962 3511 * 2963 3512 * @uses bp_get_send_public_message_link() 2964 3513 */ … … 2969 3518 /** 2970 3519 * Return the public message link for the displayed user. 2971 3520 * 2972 * @since BuddyPress (1.2 )3521 * @since BuddyPress (1.2.0) 2973 3522 * 2974 3523 * @uses is_user_logged_in() 2975 3524 * @uses bp_is_my_profile() … … 2991 3540 $retval = wp_nonce_url( $url ); 2992 3541 } 2993 3542 3543 /** 3544 * Filters the public message link for the displayed user. 3545 * 3546 * @since BuddyPress (1.2.0) 3547 * 3548 * @param string $retval The URL for the public message link. 3549 */ 2994 3550 return apply_filters( 'bp_get_send_public_message_link', $retval ); 2995 3551 } 2996 3552 … … 3024 3580 /** 3025 3581 * Output the mentioned user display name. 3026 3582 * 3027 * @since BuddyPress (1.2 )3583 * @since BuddyPress (1.2.0) 3028 3584 * 3029 3585 * @see bp_get_mentioned_user_display_name() for description of parameters. 3030 3586 * @uses bp_get_mentioned_user_display_name() … … 3038 3594 /** 3039 3595 * Returns the mentioned user display name 3040 3596 * 3041 * @since BuddyPress (1.2 )3597 * @since BuddyPress (1.2.0) 3042 3598 * 3043 3599 * @uses bp_core_get_user_displayname() 3044 3600 * @uses apply_filters() To call the 'bp_get_mentioned_user_display_name' hook. … … 3056 3612 $name = __( 'a user', 'buddypress' ); 3057 3613 } 3058 3614 3615 /** 3616 * Filters the mentioned user display name. 3617 * 3618 * @since BuddyPress (1.2.0) 3619 * 3620 * @param string $name Display name for the mentioned user. 3621 * @param int|string $user_id_or_username User ID or username use for query. 3622 */ 3059 3623 return apply_filters( 'bp_get_mentioned_user_display_name', $name, $user_id_or_username ); 3060 3624 } 3061 3625 … … 3062 3626 /** 3063 3627 * Output button for sending a public message (an @-mention). 3064 3628 * 3065 * @since BuddyPress (1.2 )3629 * @since BuddyPress (1.2.0) 3066 3630 * 3067 3631 * @see bp_get_send_public_message_button() for description of parameters. 3068 3632 * @uses bp_get_send_public_message_button() … … 3076 3640 /** 3077 3641 * Return button for sending a public message (an @-mention). 3078 3642 * 3079 * @since BuddyPress (1.2 )3643 * @since BuddyPress (1.2.0) 3080 3644 * 3081 3645 * @uses bp_get_send_public_message_link() 3082 3646 * @uses wp_parse_args() … … 3114 3678 'link_class' => 'activity-button mention' 3115 3679 ) ); 3116 3680 3117 // Filter and return the HTML button 3681 /** 3682 * Filters the public message button HTML. 3683 * 3684 * @since BuddyPress (1.2.10) 3685 * 3686 * @param array $r Array of arguments for the public message button HTML. 3687 */ 3118 3688 return bp_get_button( apply_filters( 'bp_get_send_public_message_button', $r ) ); 3119 3689 } 3120 3690 … … 3121 3691 /** 3122 3692 * Output the activity post form action. 3123 3693 * 3124 * @since BuddyPress (1.2 )3694 * @since BuddyPress (1.2.0) 3125 3695 * 3126 3696 * @uses bp_get_activity_post_form_action() 3127 3697 */ … … 3132 3702 /** 3133 3703 * Return the activity post form action. 3134 3704 * 3135 * @since BuddyPress (1.2 )3705 * @since BuddyPress (1.2.0) 3136 3706 * 3137 3707 * @uses home_url() 3138 3708 * @uses bp_get_activity_root_slug() … … 3141 3711 * @return string The activity post form action. 3142 3712 */ 3143 3713 function bp_get_activity_post_form_action() { 3714 3715 /** 3716 * Filters the action url used for the activity post form. 3717 * 3718 * @since BuddyPress (1.2.0) 3719 * 3720 * @param string $action_url URL to be used for the activity post form. 3721 */ 3144 3722 return apply_filters( 'bp_get_activity_post_form_action', home_url( bp_get_activity_root_slug() . '/post/' ) ); 3145 3723 } 3146 3724 … … 3152 3730 * Avatars are wrapped in <li> elements, but you've got to provide your own 3153 3731 * <ul> or <ol> wrapper markup. 3154 3732 * 3155 * @since BuddyPress (1.7 )3733 * @since BuddyPress (1.7.0) 3156 3734 * 3157 3735 * @see bp_core_fetch_avatar() for a description of arguments. 3158 3736 * … … 3204 3782 } 3205 3783 } 3206 3784 3785 /** 3786 * Filters the list of linked avatars for users who have commented on the current activity item. 3787 * 3788 * @since BuddyPress (1.7.0) 3789 * 3790 * @param string $retval HTML markup for the list of avatars. 3791 * @param array $r Array of arguments used for each avatar. 3792 * @param array $output Array of each avatar found, before imploded into single string. 3793 */ 3207 3794 echo apply_filters( 'bp_activity_comments_user_avatars', $retval, $r, $output ); 3208 3795 } 3209 3796 … … 3210 3797 /** 3211 3798 * Return the IDs of every user who's left a comment on the current activity item. 3212 3799 * 3213 * @since BuddyPress (1.7 )3800 * @since BuddyPress (1.7.0) 3214 3801 * 3215 3802 * @return bool|array An array of IDs, or false if none are found. 3216 3803 */ … … 3221 3808 ? (array) bp_activity_recurse_comments_user_ids( $activities_template->activity->children ) 3222 3809 : array(); 3223 3810 3811 /** 3812 * Filters the list of user IDs for the current activity item. 3813 * 3814 * @since BuddyPress (1.7.0) 3815 * 3816 * @param array $user_ids Array of unique user IDs for the current activity item. 3817 */ 3224 3818 return apply_filters( 'bp_activity_get_comments_user_ids', array_unique( $user_ids ) ); 3225 3819 } 3226 3820 … … 3227 3821 /** 3228 3822 * Recurse through all activity comments and collect the IDs of the users who wrote them. 3229 3823 * 3230 * @since BuddyPress (1.7 )3824 * @since BuddyPress (1.7.0) 3231 3825 * 3232 3826 * @param array $comments Array of {@link BP_Activity_Activity} items. 3233 3827 * @return array Array of user IDs. … … 3257 3851 } 3258 3852 } 3259 3853 3260 // Filter and return 3854 /** 3855 * Filters the list of user IDs for the current activity comment item. 3856 * 3857 * @since BuddyPress (2.1.0) 3858 * 3859 * @param array $user_ids Array of user IDs for the current activity comment item. 3860 * @param array $comments Array of comments being checked for user IDs. 3861 */ 3261 3862 return apply_filters( 'bp_activity_recurse_comments_user_ids', $user_ids, $comments ); 3262 3863 } 3263 3864 … … 3277 3878 * @return string Mentionname for the displayed user, if available. 3278 3879 */ 3279 3880 function bp_get_displayed_user_mentionname() { 3881 3882 /** 3883 * Filters the mentionname for the displayed user. 3884 * 3885 * @since BuddyPress (1.9.0) 3886 * 3887 * @param string $mentionname The mentionanme for the displayed user. 3888 */ 3280 3889 return apply_filters( 'bp_get_displayed_user_mentionname', bp_activity_get_user_mentionname( bp_displayed_user_id() ) ); 3281 3890 } 3282 3891 … … 3283 3892 /** 3284 3893 * Echo a list of all registered activity types for use in dropdowns or checkbox lists. 3285 3894 * 3286 * @since BuddyPress (1.7 )3895 * @since BuddyPress (1.7.0) 3287 3896 * 3288 3897 * @param string $output Optional. Either 'select' or 'checkbox'. Default: 'select'. 3289 3898 * @param array $args { … … 3321 3930 break; 3322 3931 } 3323 3932 3324 // Allow custom markup 3933 /** 3934 * Fires at the end of the listing of activity types. 3935 * 3936 * This is a variable action hook. The actual hook to use will depend on the output type specified. Two default hooks are bp_activity_types_list_select and bp_activity_types_list_checkbox. 3937 * 3938 * @since BuddyPress (1.7.0) 3939 * 3940 * @param array $args Array of arguments passed into function. 3941 * @param string $type Activity type being rendered in the output. 3942 * @param string $description Description of the activity type being rendered. 3943 */ 3325 3944 do_action( 'bp_activity_types_list_' . $output, $args, $type, $description ); 3326 3945 } 3327 3946 … … 3337 3956 /** 3338 3957 * Output the sitewide activity feed link. 3339 3958 * 3340 * @since BuddyPress (1.0 )3959 * @since BuddyPress (1.0.0) 3341 3960 * 3342 3961 * @uses bp_get_sitewide_activity_feed_link() 3343 3962 */ … … 3348 3967 /** 3349 3968 * Returns the sitewide activity feed link. 3350 3969 * 3351 * @since BuddyPress (1.0 )3970 * @since BuddyPress (1.0.0) 3352 3971 * 3353 3972 * @uses home_url() 3354 3973 * @uses bp_get_activity_root_slug() … … 3357 3976 * @return string The sitewide activity feed link. 3358 3977 */ 3359 3978 function bp_get_sitewide_activity_feed_link() { 3979 3980 /** 3981 * Filters the sidewide activity feed link. 3982 * 3983 * @since BuddyPress (1.0.0) 3984 * 3985 * @param string $feed_link The feed link for sitewide activity. 3986 */ 3360 3987 return apply_filters( 'bp_get_sitewide_activity_feed_link', bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/feed/' ); 3361 3988 } 3362 3989 … … 3363 3990 /** 3364 3991 * Output the member activity feed link. 3365 3992 * 3366 * @since BuddyPress (1.2 )3993 * @since BuddyPress (1.2.0) 3367 3994 * 3368 3995 * @uses bp_get_member_activity_feed_link() 3369 3996 */ … … 3374 4001 /** 3375 4002 * Output the member activity feed link. 3376 4003 * 3377 * @since BuddyPress (1.0 )3378 * @deprecated BuddyPress (1.2 )4004 * @since BuddyPress (1.0.0) 4005 * @deprecated BuddyPress (1.2.0) 3379 4006 * 3380 4007 * @todo properly deprecate in favor of bp_member_activity_feed_link(). 3381 4008 * … … 3386 4013 /** 3387 4014 * Return the member activity feed link. 3388 4015 * 3389 * @since BuddyPress (1.2 )4016 * @since BuddyPress (1.2.0) 3390 4017 * 3391 4018 * @uses bp_is_profile_component() 3392 4019 * @uses bp_is_current_action() … … 3426 4053 $link = ''; 3427 4054 } 3428 4055 4056 /** 4057 * Filters the member activity feed link. 4058 * 4059 * @since BuddyPress (1.0.0) 4060 * 4061 * @param string $link URL for the member activity feed. 4062 */ 3429 4063 return apply_filters( 'bp_get_activities_member_rss_link', $link ); 3430 4064 } 3431 4065 … … 3432 4066 /** 3433 4067 * Return the member activity feed link. 3434 4068 * 3435 * @since BuddyPress (1.0 )3436 * @deprecated BuddyPress (1.2 )4069 * @since BuddyPress (1.0.0) 4070 * @deprecated BuddyPress (1.2.0) 3437 4071 * 3438 4072 * @todo properly deprecate in favor of bp_get_member_activity_feed_link(). 3439 4073 * … … 3449 4083 /** 3450 4084 * Outputs the activity feed item guid. 3451 4085 * 3452 * @since BuddyPress (1.0 )4086 * @since BuddyPress (1.0.0) 3453 4087 * 3454 4088 * @uses bp_activity_feed_item_guid() 3455 4089 */ … … 3460 4094 /** 3461 4095 * Returns the activity feed item guid. 3462 4096 * 3463 * @since BuddyPress (1.2 )4097 * @since BuddyPress (1.2.0) 3464 4098 * 3465 4099 * @global object $activities_template {@link BP_Activity_Template} 3466 4100 * @uses apply_filters() To call the 'bp_get_activity_feed_item_guid' hook. … … 3470 4104 function bp_get_activity_feed_item_guid() { 3471 4105 global $activities_template; 3472 4106 4107 /** 4108 * Filters the activity feed item guid. 4109 * 4110 * @since BuddyPress (1.1.3) 4111 * 4112 * @param string $guid Calculated md5 value for the activity feed item. 4113 */ 3473 4114 return apply_filters( 'bp_get_activity_feed_item_guid', md5( $activities_template->activity->date_recorded . '-' . $activities_template->activity->content ) ); 3474 4115 } 3475 4116 … … 3476 4117 /** 3477 4118 * Output the activity feed item title. 3478 4119 * 3479 * @since BuddyPress (1.0 )4120 * @since BuddyPress (1.0.0) 3480 4121 * 3481 4122 * @uses bp_get_activity_feed_item_title() 3482 4123 */ … … 3487 4128 /** 3488 4129 * Return the activity feed item title. 3489 4130 * 3490 * @since BuddyPress (1.0 )4131 * @since BuddyPress (1.0.0) 3491 4132 * 3492 4133 * @global object $activities_template {@link BP_Activity_Template} 3493 4134 * @uses ent2ncr() … … 3517 4158 $title .= ': ' . strip_tags( ent2ncr( trim( convert_chars( bp_create_excerpt( $activities_template->activity->content, 70, array( 'ending' => " […]" ) ) ) ) ) ); 3518 4159 } 3519 4160 4161 /** 4162 * Filters the activity feed item title. 4163 * 4164 * @since BuddyPress (1.0.0) 4165 * 4166 * @param string $title The title for the activity feed item. 4167 */ 3520 4168 return apply_filters( 'bp_get_activity_feed_item_title', $title ); 3521 4169 } 3522 4170 … … 3523 4171 /** 3524 4172 * Output the activity feed item link 3525 4173 * 3526 * @since BuddyPress (1.0 )4174 * @since BuddyPress (1.0.0) 3527 4175 * 3528 4176 * @uses bp_get_activity_feed_item_link() 3529 4177 */ … … 3534 4182 /** 3535 4183 * Return the activity feed item link 3536 4184 * 3537 * @since BuddyPress (1.0 )4185 * @since BuddyPress (1.0.0) 3538 4186 * 3539 4187 * @global object $activities_template {@link BP_Activity_Template} 3540 4188 * @uses apply_filters() To call the 'bp_get_activity_feed_item_link' hook. … … 3548 4196 ? $activities_template->activity->primary_link 3549 4197 : ''; 3550 4198 4199 /** 4200 * Filters the activity feed item link. 4201 * 4202 * @since BuddyPress (1.0.0) 4203 * 4204 * @param string $retval The URL for the activity feed item. 4205 */ 3551 4206 return apply_filters( 'bp_get_activity_feed_item_link', $retval ); 3552 4207 } 3553 4208 … … 3554 4209 /** 3555 4210 * Output the activity feed item date. 3556 4211 * 3557 * @since BuddyPress (1.0 )4212 * @since BuddyPress (1.0.0) 3558 4213 * 3559 4214 * @uses bp_get_activity_feed_item_date() 3560 4215 */ … … 3565 4220 /** 3566 4221 * Return the activity feed item date. 3567 4222 * 3568 * @since BuddyPress (1.0 )4223 * @since BuddyPress (1.0.0) 3569 4224 * 3570 4225 * @global object $activities_template {@link BP_Activity_Template} 3571 4226 * @uses apply_filters() To call the 'bp_get_activity_feed_item_date' hook. … … 3579 4234 ? $activities_template->activity->date_recorded 3580 4235 : ''; 3581 4236 4237 /** 4238 * Filters the activity feed item date. 4239 * 4240 * @since BuddyPress (1.0.0) 4241 * 4242 * @param string $retval The date for the activity feed item. 4243 */ 3582 4244 return apply_filters( 'bp_get_activity_feed_item_date', $retval ); 3583 4245 } 3584 4246 … … 3585 4247 /** 3586 4248 * Output the activity feed item description. 3587 4249 * 3588 * @since BuddyPress (1.0 )4250 * @since BuddyPress (1.0.0) 3589 4251 * 3590 4252 * @uses bp_get_activity_feed_item_description() 3591 4253 */ … … 3596 4258 /** 3597 4259 * Return the activity feed item description. 3598 4260 * 3599 * @since BuddyPress (1.0 )4261 * @since BuddyPress (1.0.0) 3600 4262 * 3601 4263 * @global object $activities_template {@link BP_Activity_Template} 3602 4264 * @uses ent2ncr() … … 3618 4280 $content = ent2ncr( convert_chars( str_replace( '%s', '', $content ) ) ); 3619 4281 } 3620 4282 4283 /** 4284 * Filters the activity feed item description. 4285 * 4286 * @since BuddyPress (1.0.0) 4287 * 4288 * @param string $retval The description for the activity feed item. 4289 */ 3621 4290 return apply_filters( 'bp_get_activity_feed_item_description', $content ); 3622 4291 } 3623 4292 … … 3624 4293 /** 3625 4294 * Template tag so we can hook activity feed to <head>. 3626 4295 * 3627 * @since BuddyPress (1.5 )4296 * @since BuddyPress (1.5.0) 3628 4297 * 3629 4298 * @uses bloginfo() 3630 4299 * @uses bp_sitewide_activity_feed_link() … … 3702 4371 } 3703 4372 3704 4373 /** 3705 * Modify the filteroptions available in the activity filter dropdown.4374 * Filters the options available in the activity filter dropdown. 3706 4375 * 3707 * @since BuddyPress (2. 1.0)4376 * @since BuddyPress (2.2.0) 3708 4377 * 3709 * @param array $filters Array of filter options for the given 3710 * context, in the following format: 3711 * $option_value => $option_name 3712 * @param string $context Context for the filter. 'activity' 3713 * 'member', 'member_groups', 'group'. 4378 * @param array $filters Array of filter options for the given context, in the following format: $option_value => $option_name. 4379 * @param string $context Context for the filter. 'activity', 'member', 'member_groups', 'group'. 3714 4380 */ 3715 4381 $filters = apply_filters( 'bp_get_activity_show_filters_options', $filters, $context ); 3716 4382 … … 3723 4389 } 3724 4390 } 3725 4391 4392 /** 4393 * Filters the HTML markup result for the activity filter dropdown. 4394 * 4395 * @since BuddyPress (2.1.0) 4396 * 4397 * @param string $output HTML output for the activity filter dropdown. 4398 * @param array $filters Array of filter options for the given context, in the following format: $option_value => $option_name. 4399 * @param string $context Context for the filter. 'activity', 'member', 'member_groups', 'group'. 4400 */ 3726 4401 return apply_filters( 'bp_get_activity_show_filters', $output, $filters, $context ); 3727 4402 }