Changeset 10383 for trunk/src/bp-groups/bp-groups-template.php
- Timestamp:
- 11/28/2015 03:24:45 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-template.php
r10378 r10383 661 661 * 662 662 * @since 1.0.0 663 * 664 * @param int $id ID of the current group in the loop. 665 */ 666 return apply_filters( 'bp_get_group_id', $group->id ); 663 * @since 2.5.0 Added the `$group` parameter. 664 * 665 * @param int $id ID of the current group in the loop. 666 * @param object $group Group object. 667 */ 668 return apply_filters( 'bp_get_group_id', $group->id, $group ); 667 669 } 668 670 … … 768 770 * 769 771 * @since 1.0.0 770 * 771 * @param string $name Name of the current group in the loop. 772 */ 773 return apply_filters( 'bp_get_group_name', $group->name ); 772 * @since 2.5.0 Added the `$group` parameter. 773 * 774 * @param string $name Name of the current group in the loop. 775 * @param object $group Group object. 776 */ 777 return apply_filters( 'bp_get_group_name', $group->name, $group ); 774 778 } 775 779 … … 812 816 * 813 817 * @since 1.0.0 814 * 815 * @param string $type Type for the current group in the loop. 816 */ 817 return apply_filters( 'bp_get_group_type', $type ); 818 * @since 2.5.0 Added the `$group` parameter. 819 * 820 * @param string $type Type for the current group in the loop. 821 * @param object $group Group object. 822 */ 823 return apply_filters( 'bp_get_group_type', $type, $group ); 818 824 } 819 825 /** … … 844 850 * 845 851 * @since 1.0.0 852 * @since 2.5.0 Added the `$group` parameter. 846 853 * 847 854 * @param string $status Status of the current group in the loop. 848 */ 849 return apply_filters( 'bp_get_group_status', $group->status ); 855 * @param object $group Group object. 856 */ 857 return apply_filters( 'bp_get_group_status', $group->status, $group ); 850 858 } 851 859 … … 1037 1045 * 1038 1046 * @since 1.0.0 1047 * @since 2.5.0 Added the `$group` parameter. 1039 1048 * 1040 1049 * @param string $value Determined last active value for the current group. 1050 * @param object $group Group object. 1041 1051 */ 1042 return apply_filters( 'bp_get_group_last_active', bp_core_time_since( $last_active ) );1052 return apply_filters( 'bp_get_group_last_active', bp_core_time_since( $last_active ), $group ); 1043 1053 } 1044 1054 } … … 1071 1081 * 1072 1082 * @since 1.0.0 1083 * @since 2.5.0 Added the `$group` parameter. 1073 1084 * 1074 1085 * @param string $value Permalink for the current group in the loop. 1075 */ 1076 return apply_filters( 'bp_get_group_permalink', trailingslashit( bp_get_groups_directory_permalink() . $group->slug . '/' ) ); 1086 * @param object $group Group object. 1087 */ 1088 return apply_filters( 'bp_get_group_permalink', trailingslashit( bp_get_groups_directory_permalink() . $group->slug . '/' ), $group ); 1077 1089 } 1078 1090 … … 1104 1116 * 1105 1117 * @since 1.0.0 1118 * @since 2.5.0 Added the `$group` parameter. 1106 1119 * 1107 1120 * @param string $value Permalink for the admin section of the current group in the loop. 1108 */ 1109 return apply_filters( 'bp_get_group_admin_permalink', trailingslashit( bp_get_group_permalink( $group ) . 'admin' ) ); 1121 * @param object $group Group object. 1122 */ 1123 return apply_filters( 'bp_get_group_admin_permalink', trailingslashit( bp_get_group_permalink( $group ) . 'admin' ), $group ); 1110 1124 } 1111 1125 … … 1137 1151 * 1138 1152 * @since 1.0.0 1139 * 1140 * @param string $slug Slug for the current group in the loop. 1141 */ 1142 return apply_filters( 'bp_get_group_slug', $group->slug ); 1153 * @since 2.5.0 Added the `$group` parameter. 1154 * 1155 * @param string $slug Slug for the current group in the loop. 1156 * @param object $group Group object. 1157 */ 1158 return apply_filters( 'bp_get_group_slug', $group->slug, $group ); 1143 1159 } 1144 1160 … … 1170 1186 * 1171 1187 * @since 1.0.0 1188 * @since 2.5.0 Added the `$group` parameter. 1172 1189 * 1173 1190 * @param string $value Description for the current group. 1174 */ 1175 return apply_filters( 'bp_get_group_description', stripslashes($group->description) ); 1191 * @param object $group Group object. 1192 */ 1193 return apply_filters( 'bp_get_group_description', stripslashes( $group->description ), $group ); 1176 1194 } 1177 1195 … … 1206 1224 * Filters the permalink for the current group in the loop, for use in a textarea. 1207 1225 * 1208 * 'bp_get_group_description_editable' does not have the formatting 1209 * filters that 'bp_get_group_description' has, which makes it 1210 * appropriate for "raw" editing. 1226 * 'bp_get_group_description_editable' does not have the formatting filters that 1227 * 'bp_get_group_description' has, which makes it appropriate for "raw" editing. 1211 1228 * 1212 1229 * @since 1.0.0 1230 * @since 2.5.0 Added the `$group` parameter. 1213 1231 * 1214 1232 * @param string $description Description for the current group in the loop. 1215 */ 1216 return apply_filters( 'bp_get_group_description_editable', $group->description ); 1233 * @param object $group Group object. 1234 */ 1235 return apply_filters( 'bp_get_group_description_editable', $group->description, $group ); 1217 1236 } 1218 1237 … … 1314 1333 } 1315 1334 1316 return apply_filters( 'bp_get_group_is_public', $group->is_public ); 1335 /** 1336 * Filters whether the current group in the loop is public. 1337 * 1338 * @since 2.5.0 Added the `$group` parameter. 1339 * 1340 * @param bool $public True if the group is public. 1341 * @param object $group Group object. 1342 */ 1343 return apply_filters( 'bp_get_group_is_public', $group->is_public, $group ); 1317 1344 } 1318 1345 … … 1344 1371 * 1345 1372 * @since 1.0.0 1373 * @since 2.5.0 Added the `$group` parameter. 1346 1374 * 1347 1375 * @param string $value Created date for the current group. 1348 */ 1349 return apply_filters( 'bp_get_group_date_created', bp_core_time_since( strtotime( $group->date_created ) ) ); 1376 * @param object $group Group object. 1377 */ 1378 return apply_filters( 'bp_get_group_date_created', bp_core_time_since( strtotime( $group->date_created ) ), $group ); 1350 1379 } 1351 1380 … … 1377 1406 * 1378 1407 * @since 1.7.0 1408 * @since 2.5.0 Added the `$group` parameter. 1379 1409 * 1380 1410 * @param string $value Username of the group creator. 1381 */ 1382 return apply_filters( 'bp_get_group_creator_username', bp_core_get_user_displayname( $group->creator_id ) ); 1411 * @param object $group Group object. 1412 */ 1413 return apply_filters( 'bp_get_group_creator_username', bp_core_get_user_displayname( $group->creator_id ), $group ); 1383 1414 } 1384 1415 … … 1410 1441 * 1411 1442 * @since 1.7.0 1443 * @since 2.5.0 Added the `$group` parameter. 1412 1444 * 1413 1445 * @param int $creator_id User ID of the group creator. 1414 */ 1415 return apply_filters( 'bp_get_group_creator_id', $group->creator_id ); 1446 * @param object $group Group object. 1447 */ 1448 return apply_filters( 'bp_get_group_creator_id', $group->creator_id, $group ); 1416 1449 } 1417 1450 … … 1443 1476 * 1444 1477 * @since 1.7.0 1478 * @since 2.5.0 Added the `$group` parameter. 1445 1479 * 1446 1480 * @param string $value Permalink of the group creator. 1447 */ 1448 return apply_filters( 'bp_get_group_creator_permalink', bp_core_get_user_domain( $group->creator_id ) ); 1481 * @param object $group Group object. 1482 */ 1483 return apply_filters( 'bp_get_group_creator_permalink', bp_core_get_user_domain( $group->creator_id ), $group ); 1449 1484 } 1450 1485 … … 1527 1562 * 1528 1563 * @since 1.7.0 1564 * @since 2.5.0 Added the `$group` parameter. 1529 1565 * 1530 1566 * @param string $avatar Avatar of the group creator. 1531 */ 1532 return apply_filters( 'bp_get_group_creator_avatar', $avatar ); 1567 * @param object $group Group object. 1568 */ 1569 return apply_filters( 'bp_get_group_creator_avatar', $avatar, $group ); 1533 1570 } 1534 1571 … … 1679 1716 * 1680 1717 * @since 1.5.0 1718 * @since 2.5.0 Added the `$group` parameter. 1681 1719 * 1682 1720 * @param array|string $admin_ids List of user IDs for a group's admins. 1683 */ 1684 return apply_filters( 'bp_group_admin_ids', $admin_ids ); 1721 * @param object $group Group object. 1722 */ 1723 return apply_filters( 'bp_group_admin_ids', $admin_ids, $group ); 1685 1724 } 1686 1725 … … 1721 1760 * 1722 1761 * @since 1.5.0 1762 * @since 2.5.0 Added the `$group` parameter. 1723 1763 * 1724 1764 * @param array|string $admin_ids List of user IDs for a group's moderators. 1725 */ 1726 return apply_filters( 'bp_group_mod_ids', $mod_ids ); 1765 * @param object $group Group object. 1766 */ 1767 return apply_filters( 'bp_group_mod_ids', $mod_ids, $group ); 1727 1768 } 1728 1769 … … 1751 1792 * 1752 1793 * @since 1.0.0 1794 * @since 2.5.0 Added the `$group` parameter. 1753 1795 * 1754 1796 * @param string $value Permalink of the Members page for the current group. 1755 */ 1756 return apply_filters( 'bp_get_group_all_members_permalink', bp_get_group_permalink( $group ) . 'members' ); 1797 * @param object $group Group object. 1798 */ 1799 return apply_filters( 'bp_get_group_all_members_permalink', bp_get_group_permalink( $group ) . 'members', $group ); 1757 1800 } 1758 1801 … … 1923 1966 * 1924 1967 * @since 1.0.0 1925 * 1926 * @param int $total_member_count Total member count for a group. 1927 */ 1928 return apply_filters( 'bp_get_group_total_members', $group->total_member_count ); 1968 * @since 2.5.0 Added the `$group` parameter. 1969 * 1970 * @param int $total_member_count Total member count for a group. 1971 * @param object $group Group object. 1972 */ 1973 return apply_filters( 'bp_get_group_total_members', $group->total_member_count, $group ); 1929 1974 } 1930 1975 … … 1985 2030 * 1986 2031 * @since 1.0.0 2032 * @since 2.5.0 Added the `$group` parameter. 1987 2033 * 1988 2034 * @param string $value URL permalink for the Forum Page. 1989 */ 1990 return apply_filters( 'bp_get_group_forum_permalink', bp_get_group_permalink( $group ) . 'forum' ); 2035 * @param object $group Group object. 2036 */ 2037 return apply_filters( 'bp_get_group_forum_permalink', bp_get_group_permalink( $group ) . 'forum', $group ); 1991 2038 } 1992 2039 … … 2485 2532 * 2486 2533 * @since 1.0.0 2487 * 2488 * @param array $value Array of user IDs who are a moderator of the provided group. 2489 */ 2490 return apply_filters( 'bp_group_has_moderators', groups_get_group_mods( $group->id ) ); 2534 * @since 2.5.0 Added the `$group` parameter. 2535 * 2536 * @param array $value Array of user IDs who are a moderator of the provided group. 2537 * @param object $group Group object. 2538 */ 2539 return apply_filters( 'bp_group_has_moderators', groups_get_group_mods( $group->id ), $group ); 2491 2540 } 2492 2541 … … 2607 2656 * 2608 2657 * @since 1.0.0 2658 * @since 2.5.0 Added the `$group` parameter. 2609 2659 * 2610 2660 * @param string $value URL to use for demoting a user to member. 2611 */ 2612 return apply_filters( 'bp_get_group_member_demote_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/demote/' . $user_id, 'groups_demote_member' ) ); 2661 * @param object $group Group object. 2662 */ 2663 return apply_filters( 'bp_get_group_member_demote_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/demote/' . $user_id, 'groups_demote_member' ), $group ); 2613 2664 } 2614 2665 … … 2731 2782 * 2732 2783 * @since 1.2.6 2784 * @since 2.5.0 Added the `$group` parameter. 2733 2785 * 2734 2786 * @param string $value URL to use for removing a member. 2735 */ 2736 return apply_filters( 'bp_get_group_member_remove_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/remove/' . $user_id, 'groups_remove_member' ) ); 2787 * @param object $group Group object. 2788 */ 2789 return apply_filters( 'bp_get_group_member_remove_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/remove/' . $user_id, 'groups_remove_member' ), $group ); 2737 2790 } 2738 2791 … … 2844 2897 * 2845 2898 * @since 1.0.0 2899 * @since 2.5.0 Added the `$group` parameter. 2846 2900 * 2847 2901 * @param string $value Action attribute for a group form. 2848 */ 2849 return apply_filters( 'bp_group_form_action', bp_get_group_permalink( $group ) . $page ); 2902 * @param object $group Group object. 2903 */ 2904 return apply_filters( 'bp_group_form_action', bp_get_group_permalink( $group ) . $page, $group ); 2850 2905 } 2851 2906 … … 2881 2936 * 2882 2937 * @since 1.0.0 2938 * @since 2.5.0 Added the `$group` parameter. 2883 2939 * 2884 2940 * @param string $value Action attribute for a group admin form. 2885 */ 2886 return apply_filters( 'bp_group_admin_form_action', bp_get_group_permalink( $group ) . 'admin/' . $page ); 2941 * @param object $group Group object. 2942 */ 2943 return apply_filters( 'bp_group_admin_form_action', bp_get_group_permalink( $group ) . 'admin/' . $page, $group ); 2887 2944 } 2888 2945 … … 2933 2990 * 2934 2991 * @since 1.2.4 2935 * 2936 * @param bool $is_member If user is a member of group or not. 2937 */ 2938 return apply_filters( 'bp_group_is_member', !empty( $group->is_member ) ); 2992 * @since 2.5.0 Added the `$group` parameter. 2993 * 2994 * @param bool $is_member If user is a member of group or not. 2995 * @param object $group Group object. 2996 */ 2997 return apply_filters( 'bp_group_is_member', ! empty( $group->is_member ), $group ); 2939 2998 } 2940 2999 … … 2957 3016 * 2958 3017 * @since 2.1.0 2959 * 2960 * @param bool $is_invited If user has an outstanding group invite. 2961 */ 2962 return apply_filters( 'bp_group_is_invited', ! empty( $group->is_invited ) ); 3018 * @since 2.5.0 Added the `$group` parameter. 3019 * 3020 * @param bool $is_invited If user has an outstanding group invite. 3021 * @param object $group Group object. 3022 */ 3023 return apply_filters( 'bp_group_is_invited', ! empty( $group->is_invited ), $group ); 2963 3024 } 2964 3025 … … 3019 3080 * 3020 3081 * @since 1.5.0 3021 * 3022 * @param bool $is_invited If user has been from current group. 3023 */ 3024 return (bool) apply_filters( 'bp_group_is_user_banned', $retval ); 3082 * @since 2.5.0 Added the `$group` parameter. 3083 * 3084 * @param bool $is_invited If user has been from current group. 3085 * @param object $group Group object. 3086 */ 3087 return (bool) apply_filters( 'bp_group_is_user_banned', $retval, $group ); 3025 3088 } 3026 3089 … … 3051 3114 * 3052 3115 * @since 1.0.0 3116 * @since 2.5.0 Added the `$group` parameter. 3053 3117 * 3054 3118 * @param string $value URL for accepting an invitation to a group. 3055 */ 3056 return apply_filters( 'bp_get_group_accept_invite_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/invites/accept/' . $group->id ), 'groups_accept_invite' ) ); 3119 * @param object $group Group object. 3120 */ 3121 return apply_filters( 'bp_get_group_accept_invite_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/invites/accept/' . $group->id ), 'groups_accept_invite' ), $group ); 3057 3122 } 3058 3123 … … 3083 3148 * 3084 3149 * @since 1.0.0 3150 * @since 2.5.0 Added the `$group` parameter. 3085 3151 * 3086 3152 * @param string $value URL for rejecting an invitation to a group. 3087 */ 3088 return apply_filters( 'bp_get_group_reject_invite_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/invites/reject/' . $group->id ), 'groups_reject_invite' ) ); 3153 * @param object $group Group object. 3154 */ 3155 return apply_filters( 'bp_get_group_reject_invite_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/invites/reject/' . $group->id ), 'groups_reject_invite' ), $group ); 3089 3156 } 3090 3157 … … 3113 3180 * 3114 3181 * @since 1.0.0 3182 * @since 2.5.0 Added the `$group` parameter. 3115 3183 * 3116 3184 * @param string $value URL for confirming a request to leave a group. 3117 */ 3118 return apply_filters( 'bp_group_leave_confirm_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group/yes', 'groups_leave_group' ) ); 3185 * @param object $group Group object. 3186 */ 3187 return apply_filters( 'bp_group_leave_confirm_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group/yes', 'groups_leave_group' ), $group ); 3119 3188 } 3120 3189 … … 3143 3212 * 3144 3213 * @since 1.0.0 3214 * @since 2.5.0 Added the `$group` parameter. 3145 3215 * 3146 3216 * @param string $value URL for rejecting a request to leave a group. 3147 */ 3148 return apply_filters( 'bp_get_group_leave_reject_link', bp_get_group_permalink( $group ) ); 3217 * @param object $group Group object. 3218 */ 3219 return apply_filters( 'bp_get_group_leave_reject_link', bp_get_group_permalink( $group ), $group ); 3149 3220 } 3150 3221 … … 3173 3244 * 3174 3245 * @since 1.0.0 3246 * @since 2.5.0 Added the `$group` parameter. 3175 3247 * 3176 3248 * @param string $value Action attribute for a group send invite form. 3177 */ 3178 return apply_filters( 'bp_group_send_invite_form_action', bp_get_group_permalink( $group ) . 'send-invites/send' ); 3249 * @param object $group Group object. 3250 */ 3251 return apply_filters( 'bp_group_send_invite_form_action', bp_get_group_permalink( $group ) . 'send-invites/send', $group ); 3179 3252 } 3180 3253 … … 3253 3326 * 3254 3327 * @since 1.5.0 3328 * @since 2.5.0 Added the `$group` parameter. 3255 3329 * 3256 3330 * @param string $button HTML button for a new topic. 3257 */ 3258 return bp_get_button( apply_filters( 'bp_get_group_new_topic_button', $button ) ); 3331 * @param object $group Group object. 3332 */ 3333 return bp_get_button( apply_filters( 'bp_get_group_new_topic_button', $button, $group ) ); 3259 3334 } 3260 3335 … … 4338 4413 } 4339 4414 4415 /** 4416 * Filters the hierarchy of group front templates corresponding to a specific group. 4417 * 4418 * @since 2.4.0 4419 * @since 2.5.0 Added the `$group` parameter. 4420 * 4421 * @param array $template_names Array of template paths. 4422 * @param object $group Group object. 4423 */ 4340 4424 $template_names = apply_filters( 'bp_groups_get_front_template', array( 4341 4425 'groups/single/front-id-' . sanitize_file_name( $group->id ) . '.php',
Note: See TracChangeset
for help on using the changeset viewer.