Changeset 13108 for trunk/src/bp-members/bp-members-template.php
- Timestamp:
- 09/12/2021 08:43:39 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-template.php
r13105 r13108 390 390 391 391 // Type: active ( default ) | random | newest | popular | online | alphabetical. 392 $r = bp_parse_args( $args, array( 393 'type' => 'active', 394 'page' => 1, 395 'per_page' => 20, 396 'max' => false, 397 398 'page_arg' => 'upage', // See https://buddypress.trac.wordpress.org/ticket/3679. 399 400 'include' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to only show these users. 401 'exclude' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to exclude these users. 402 'user_ids' => false, 403 404 'user_id' => $user_id, // Pass a user_id to only show friends of this user. 405 'member_type' => $member_type, 406 'member_type__in' => '', 407 'member_type__not_in' => '', 408 'search_terms' => $search_terms_default, 409 410 'meta_key' => false, // Only return users with this usermeta. 411 'meta_value' => false, // Only return users where the usermeta value matches. Requires meta_key. 412 413 'xprofile_query' => false, 414 'populate_extras' => true // Fetch usermeta? Friend count, last active etc. 415 ), 'has_members' ); 392 $r = bp_parse_args( 393 $args, 394 array( 395 'type' => 'active', 396 'page' => 1, 397 'per_page' => 20, 398 'max' => false, 399 400 'page_arg' => 'upage', // See https://buddypress.trac.wordpress.org/ticket/3679. 401 402 'include' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to only show these users. 403 'exclude' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to exclude these users. 404 'user_ids' => false, 405 406 'user_id' => $user_id, // Pass a user_id to only show friends of this user. 407 'member_type' => $member_type, 408 'member_type__in' => '', 409 'member_type__not_in' => '', 410 'search_terms' => $search_terms_default, 411 412 'meta_key' => false, // Only return users with this usermeta. 413 'meta_value' => false, // Only return users where the usermeta value matches. Requires meta_key. 414 415 'xprofile_query' => false, 416 'populate_extras' => true, // Fetch usermeta? Friend count, last active etc. 417 ), 418 'has_members' 419 ); 416 420 417 421 // Pass a filter if ?s= is set. … … 843 847 : $members_template->member->display_name; 844 848 845 $r = wp_parse_args(849 $r = bp_parse_args( 846 850 $args, 847 851 array( … … 903 907 global $members_template; 904 908 909 $permalink = bp_core_get_user_domain( 910 $members_template->member->id, 911 $members_template->member->user_nicename, 912 $members_template->member->user_login 913 ); 914 905 915 /** 906 916 * Filters the permalink for the current member in the loop. … … 908 918 * @since 1.2.0 909 919 * 910 * @param string $ valuePermalink for the current member in the loop.911 */ 912 return apply_filters( 'bp_get_member_permalink', bp_core_get_user_domain( $members_template->member->id, $members_template->member->user_nicename, $members_template->member->user_login ));920 * @param string $permalink Permalink for the current member in the loop. 921 */ 922 return apply_filters( 'bp_get_member_permalink', $permalink ); 913 923 } 914 924 … … 974 984 975 985 foreach ( $name_stack as $source ) { 976 if ( ! empty( $members_template->member->{$source} ) ) {986 if ( ! empty( $members_template->member->{$source} ) ) { 977 987 // When a value is found, set it as fullname and be done with it. 978 988 $members_template->member->fullname = $members_template->member->{$source}; … … 1027 1037 1028 1038 // Parse the activity format. 1029 $r = bp_parse_args( $args, array( 1030 'active_format' => true, 1031 'relative' => true, 1032 ) ); 1039 $r = bp_parse_args( 1040 $args, 1041 array( 1042 'active_format' => true, 1043 'relative' => true, 1044 ) 1045 ); 1033 1046 1034 1047 // Backwards compatibility for anyone forcing a 'true' active_format. … … 1097 1110 $defaults = array( 1098 1111 'length' => 225, 1099 'view_link' => true 1112 'view_link' => true, 1100 1113 ); 1101 1114 1102 $r = wp_parse_args( $args, $defaults ); 1115 $r = bp_parse_args( 1116 $args, 1117 $defaults 1118 ); 1119 1103 1120 extract( $r ); 1104 1121 … … 1195 1212 ); 1196 1213 1197 $r = wp_parse_args( $args, $defaults ); 1214 $r = bp_parse_args( 1215 $args, 1216 $defaults 1217 ); 1198 1218 1199 1219 // If we're in a members loop, get the data from the global. … … 1275 1295 global $members_template; 1276 1296 1277 $r = wp_parse_args( $args, array( 1278 'relative' => true, 1279 ) ); 1297 $r = bp_parse_args( 1298 $args, 1299 array( 1300 'relative' => true, 1301 ) 1302 ); 1280 1303 1281 1304 // We do not want relative time, so return now. … … 1386 1409 * @since 1.2.0 1387 1410 * 1388 * @param int$value Number-formatted total site member count.1411 * @param string $value Number-formatted total site member count. 1389 1412 */ 1390 1413 return apply_filters( 'bp_get_total_site_member_count', bp_core_number_format( bp_core_get_total_member_count() ) ); … … 1636 1659 function bp_get_loggedin_user_avatar( $args = '' ) { 1637 1660 1638 $r = wp_parse_args( $args, array( 1639 'item_id' => bp_loggedin_user_id(), 1640 'type' => 'thumb', 1641 'width' => false, 1642 'height' => false, 1643 'html' => true, 1644 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_loggedin_user_fullname() ) 1645 ) ); 1661 $r = bp_parse_args( 1662 $args, 1663 array( 1664 'item_id' => bp_loggedin_user_id(), 1665 'type' => 'thumb', 1666 'width' => false, 1667 'height' => false, 1668 'html' => true, 1669 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_loggedin_user_fullname() ) 1670 ) 1671 ); 1646 1672 1647 1673 /** … … 1691 1717 function bp_get_displayed_user_avatar( $args = '' ) { 1692 1718 1693 $r = wp_parse_args( $args, array( 1694 'item_id' => bp_displayed_user_id(), 1695 'type' => 'thumb', 1696 'width' => false, 1697 'height' => false, 1698 'html' => true, 1699 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 1700 ) ); 1719 $r = bp_parse_args( 1720 $args, 1721 array( 1722 'item_id' => bp_displayed_user_id(), 1723 'type' => 'thumb', 1724 'width' => false, 1725 'height' => false, 1726 'html' => true, 1727 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 1728 ) 1729 ); 1701 1730 1702 1731 /** … … 2228 2257 $has_label = ! empty( $r['label'] ); 2229 2258 2230 $labels = wp_parse_args(2259 $labels = bp_parse_args( 2231 2260 $r['label'], 2232 2261 array( … … 2363 2392 * @since 1.5.0 2364 2393 * 2365 * @return bool eanTrue if page and template exist, false if not.2394 * @return bool True if page and template exist, false if not. 2366 2395 */ 2367 2396 function bp_has_custom_activation_page() { 2368 2397 static $has_page = false; 2369 2398 2370 if ( empty( $has_page ) ) 2399 if ( empty( $has_page ) ) { 2371 2400 $has_page = bp_get_activate_slug() && bp_locate_template( array( 'registration/activate.php', 'members/activate.php', 'activate.php' ), false ); 2401 } 2372 2402 2373 2403 return (bool) $has_page; … … 2753 2783 */ 2754 2784 function bp_get_current_signup_step() { 2755 return buddypress()->signup->step;2785 return (string) buddypress()->signup->step; 2756 2786 } 2757 2787 … … 2788 2818 function bp_get_signup_avatar( $args = '' ) { 2789 2819 $bp = buddypress(); 2790 2791 $defaults = array( 2792 'size' => bp_core_avatar_full_width(), 2793 'class' => 'avatar', 2794 'alt' => __( 'Your Profile Photo', 'buddypress' ), 2820 $r = bp_parse_args( 2821 $args, 2822 array( 2823 'size' => bp_core_avatar_full_width(), 2824 'class' => 'avatar', 2825 'alt' => __( 'Your Profile Photo', 'buddypress' ), 2826 ) 2795 2827 ); 2796 2828 2797 $r = wp_parse_args( $args, $defaults );2798 2829 extract( $r, EXTR_SKIP ); 2799 2830 … … 2930 2961 * @since 1.5.0 2931 2962 * 2963 * @global BuddyPress $bp The one true BuddyPress instance. 2964 * 2932 2965 * @param string $component ID of the component (eg 'friends'). 2933 2966 * @param string $action Optional. 'action' slug (eg 'invites'). … … 3037 3070 */ 3038 3071 function bp_has_members_invitations( $args = '' ) { 3072 $bp = buddypress(); 3039 3073 3040 3074 // Get the user ID. … … 3045 3079 } 3046 3080 3047 // Set the search terms (by default an empty string to get all notifications) 3081 // Set the search terms (by default an empty string to get all notifications). 3048 3082 $search_terms = ''; 3049 3083 … … 3053 3087 3054 3088 // Parse the args. 3055 $r = bp_parse_args( $args, array( 3056 'id' => false, 3057 'inviter_id' => $user_id, 3058 'invitee_email' => false, 3059 'item_id' => false, 3060 'type' => 'invite', 3061 'invite_sent' => 'all', 3062 'accepted' => 'pending', 3063 'search_terms' => $search_terms, 3064 'order_by' => 'date_modified', 3065 'sort_order' => 'DESC', 3066 'page' => 1, 3067 'per_page' => 25, 3068 'fields' => 'all', 3069 3070 // These are additional arguments that are not available in 3071 // BP_Invitations_Invitation::get(). 3072 'page_arg' => 'ipage', 3073 ), 'has_members_invitations' ); 3089 $r = bp_parse_args( 3090 $args, 3091 array( 3092 'id' => false, 3093 'inviter_id' => $user_id, 3094 'invitee_email' => false, 3095 'item_id' => false, 3096 'type' => 'invite', 3097 'invite_sent' => 'all', 3098 'accepted' => 'pending', 3099 'search_terms' => $search_terms, 3100 'order_by' => 'date_modified', 3101 'sort_order' => 'DESC', 3102 'page' => 1, 3103 'per_page' => 25, 3104 'fields' => 'all', 3105 3106 // These are additional arguments that are not available in 3107 // BP_Invitations_Invitation::get(). 3108 'page_arg' => 'ipage', 3109 ), 3110 'has_members_invitations' 3111 ); 3074 3112 3075 3113 // Get the notifications. … … 3077 3115 3078 3116 // Setup the global query loop. 3079 buddypress()->members->invitations->query_loop = $query_loop;3117 $bp->members->invitations->query_loop = $query_loop; 3080 3118 3081 3119 /** … … 3288 3326 3289 3327 // Parse. 3290 $r = wp_parse_args( $args, array( 3291 'before' => '', 3292 'after' => '', 3293 'sep' => ' | ', 3294 'links' => array( 3295 bp_get_the_members_invitation_resend_link( $inviter_id ), 3296 bp_get_the_members_invitation_delete_link( $inviter_id ) 3328 $r = bp_parse_args( 3329 $args, 3330 array( 3331 'before' => '', 3332 'after' => '', 3333 'sep' => ' | ', 3334 'links' => array( 3335 bp_get_the_members_invitation_resend_link( $inviter_id ), 3336 bp_get_the_members_invitation_delete_link( $inviter_id ) 3337 ) 3297 3338 ) 3298 ) );3339 ); 3299 3340 3300 3341 // Build the links.
Note: See TracChangeset
for help on using the changeset viewer.