diff --git src/bp-groups/bp-groups-activity.php src/bp-groups/bp-groups-activity.php
index cb7c69c..92f8f1e 100644
|
|
function groups_record_activity( $args = '' ) { |
362 | 362 | } |
363 | 363 | } |
364 | 364 | |
365 | | $r = wp_parse_args( $args, array( |
| 365 | $r = bp_parse_args( $args, array( |
366 | 366 | 'id' => false, |
367 | 367 | 'user_id' => bp_loggedin_user_id(), |
368 | 368 | 'action' => '', |
… |
… |
function groups_record_activity( $args = '' ) { |
375 | 375 | 'recorded_time' => bp_core_current_time(), |
376 | 376 | 'hide_sitewide' => $hide_sitewide, |
377 | 377 | 'error_type' => 'bool' |
378 | | ) ); |
| 378 | ), 'groups_record_activity' ); |
379 | 379 | |
380 | 380 | return bp_activity_add( $r ); |
381 | 381 | } |
diff --git src/bp-groups/bp-groups-functions.php src/bp-groups/bp-groups-functions.php
index 70dbdf1..0a5f1a8 100644
|
|
function groups_get_group( $group_id ) { |
48 | 48 | * Old-style arguments take the form of an array or a query string. |
49 | 49 | */ |
50 | 50 | if ( ! is_numeric( $group_id ) ) { |
51 | | $r = wp_parse_args( $group_id, array( |
| 51 | $r = bp_parse_args( $group_id, array( |
52 | 52 | 'group_id' => false, |
53 | 53 | 'load_users' => false, |
54 | 54 | 'populate_extras' => false, |
55 | | ) ); |
| 55 | ), 'groups_get_group' ); |
56 | 56 | |
57 | 57 | $group_id = $r['group_id']; |
58 | 58 | } |
… |
… |
function groups_get_group( $group_id ) { |
98 | 98 | */ |
99 | 99 | function groups_create_group( $args = '' ) { |
100 | 100 | |
101 | | $defaults = array( |
| 101 | $args = bp_parse_args( $args, array( |
102 | 102 | 'group_id' => 0, |
103 | 103 | 'creator_id' => 0, |
104 | 104 | 'name' => '', |
… |
… |
function groups_create_group( $args = '' ) { |
108 | 108 | 'parent_id' => 0, |
109 | 109 | 'enable_forum' => 0, |
110 | 110 | 'date_created' => bp_core_current_time() |
111 | | ); |
112 | | |
113 | | $args = wp_parse_args( $args, $defaults ); |
| 111 | ), 'groups_create_group' ); |
114 | 112 | extract( $args, EXTR_SKIP ); |
115 | 113 | |
116 | 114 | // Pass an existing group ID. |
… |
… |
function groups_edit_base_group_details( $args = array() ) { |
245 | 243 | $args = bp_core_parse_args_array( $old_args_keys, func_get_args() ); |
246 | 244 | } |
247 | 245 | |
248 | | $r = wp_parse_args( $args, array( |
| 246 | $r = bp_parse_args( $args, array( |
249 | 247 | 'group_id' => bp_get_current_group_id(), |
250 | 248 | 'name' => null, |
251 | 249 | 'slug' => null, |
252 | 250 | 'description' => null, |
253 | 251 | 'notify_members' => false, |
254 | | ) ); |
| 252 | ), 'groups_edit_base_group_details' ); |
255 | 253 | |
256 | 254 | if ( ! $r['group_id'] ) { |
257 | 255 | return false; |
… |
… |
function groups_get_group_members( $args = array() ) { |
679 | 677 | $args = bp_core_parse_args_array( $old_args_keys, func_get_args() ); |
680 | 678 | } |
681 | 679 | |
682 | | $r = wp_parse_args( $args, array( |
| 680 | $r = bp_parse_args( $args, array( |
683 | 681 | 'group_id' => bp_get_current_group_id(), |
684 | 682 | 'per_page' => false, |
685 | 683 | 'page' => false, |
… |
… |
function groups_get_group_members( $args = array() ) { |
689 | 687 | 'group_role' => array(), |
690 | 688 | 'search_terms' => false, |
691 | 689 | 'type' => 'last_joined', |
692 | | ) ); |
| 690 | ), 'groups_get_group_members' ); |
693 | 691 | |
694 | 692 | // For legacy users. Use of BP_Groups_Member::get_all_for_group() is deprecated. |
695 | 693 | if ( apply_filters( 'bp_use_legacy_group_member_query', false, __FUNCTION__, func_get_args() ) ) { |
… |
… |
function groups_post_update( $args = '' ) { |
1261 | 1259 | |
1262 | 1260 | $bp = buddypress(); |
1263 | 1261 | |
1264 | | $defaults = array( |
| 1262 | $r = bp_parse_args( $args, array( |
1265 | 1263 | 'content' => false, |
1266 | 1264 | 'user_id' => bp_loggedin_user_id(), |
1267 | 1265 | 'group_id' => 0, |
1268 | 1266 | 'error_type' => 'bool' |
1269 | | ); |
1270 | | |
1271 | | $r = wp_parse_args( $args, $defaults ); |
| 1267 | ), 'groups_post_update' ); |
1272 | 1268 | extract( $r, EXTR_SKIP ); |
1273 | 1269 | |
1274 | 1270 | if ( empty( $group_id ) && !empty( $bp->groups->current_group->id ) ) |
… |
… |
function groups_get_invite_count_for_user( $user_id = 0 ) { |
1390 | 1386 | */ |
1391 | 1387 | function groups_invite_user( $args = '' ) { |
1392 | 1388 | |
1393 | | $defaults = array( |
| 1389 | $args = bp_parse_args( $args, array( |
1394 | 1390 | 'user_id' => false, |
1395 | 1391 | 'group_id' => false, |
1396 | 1392 | 'inviter_id' => bp_loggedin_user_id(), |
1397 | 1393 | 'date_modified' => bp_core_current_time(), |
1398 | 1394 | 'is_confirmed' => 0 |
1399 | | ); |
1400 | | |
1401 | | $args = wp_parse_args( $args, $defaults ); |
| 1395 | ), 'groups_invite_user' ); |
1402 | 1396 | extract( $args, EXTR_SKIP ); |
1403 | 1397 | |
1404 | 1398 | if ( ! $user_id || ! $group_id || ! $inviter_id ) { |
diff --git src/bp-groups/bp-groups-template.php src/bp-groups/bp-groups-template.php
index ac0d315..a80a475 100644
|
|
function bp_group_last_active( $group = false, $args = array() ) { |
925 | 925 | $group =& $groups_template->group; |
926 | 926 | } |
927 | 927 | |
928 | | $r = wp_parse_args( $args, array( |
| 928 | $r = bp_parse_args( $args, array( |
929 | 929 | 'relative' => true, |
930 | | ) ); |
| 930 | ), 'group_last_active' ); |
931 | 931 | |
932 | 932 | $last_active = $group->last_activity; |
933 | 933 | if ( ! $last_active ) { |
… |
… |
function bp_group_date_created( $group = false, $args = array() ) { |
1353 | 1353 | function bp_get_group_date_created( $group = false, $args = array() ) { |
1354 | 1354 | global $groups_template; |
1355 | 1355 | |
1356 | | $r = wp_parse_args( $args, array( |
| 1356 | $r = bp_parse_args( $args, array( |
1357 | 1357 | 'relative' => true, |
1358 | | ) ); |
| 1358 | ), 'group_date_created' ); |
1359 | 1359 | |
1360 | 1360 | if ( empty( $group ) ) { |
1361 | 1361 | $group =& $groups_template->group; |
… |
… |
function bp_group_creator_avatar( $group = false, $args = array() ) { |
1561 | 1561 | $group =& $groups_template->group; |
1562 | 1562 | } |
1563 | 1563 | |
1564 | | $defaults = array( |
| 1564 | $r = bp_parse_args( $args, array( |
1565 | 1565 | 'type' => 'full', |
1566 | 1566 | 'width' => false, |
1567 | 1567 | 'height' => false, |
1568 | 1568 | 'class' => 'avatar', |
1569 | 1569 | 'id' => false, |
1570 | 1570 | 'alt' => sprintf( __( 'Group creator profile photo of %s', 'buddypress' ), bp_core_get_user_displayname( $group->creator_id ) ) |
1571 | | ); |
1572 | | |
1573 | | $r = wp_parse_args( $args, $defaults ); |
| 1571 | ), 'group_creator_avatar' ); |
1574 | 1572 | extract( $r, EXTR_SKIP ); |
1575 | 1573 | |
1576 | 1574 | $avatar = bp_core_fetch_avatar( array( 'item_id' => $group->creator_id, 'type' => $type, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'alt' => $alt ) ); |
… |
… |
function bp_group_forum_topic_count( $args = '' ) { |
2089 | 2087 | function bp_get_group_forum_topic_count( $args = '' ) { |
2090 | 2088 | global $groups_template; |
2091 | 2089 | |
2092 | | $defaults = array( |
| 2090 | $r = bp_parse_args( $args, array( |
2093 | 2091 | 'showtext' => false |
2094 | | ); |
2095 | | |
2096 | | $r = wp_parse_args( $args, $defaults ); |
| 2092 | ), 'group_forum_topic_count' ); |
2097 | 2093 | extract( $r, EXTR_SKIP ); |
2098 | 2094 | |
2099 | 2095 | if ( !$forum_id = groups_get_groupmeta( $groups_template->group->id, 'forum_id' ) ) { |
… |
… |
function bp_group_forum_post_count( $args = '' ) { |
2155 | 2151 | function bp_get_group_forum_post_count( $args = '' ) { |
2156 | 2152 | global $groups_template; |
2157 | 2153 | |
2158 | | $defaults = array( |
| 2154 | $r = bp_parse_args( $args, array( |
2159 | 2155 | 'showtext' => false |
2160 | | ); |
2161 | | |
2162 | | $r = wp_parse_args( $args, $defaults ); |
| 2156 | ), 'group_forum_post_count' ); |
2163 | 2157 | extract( $r, EXTR_SKIP ); |
2164 | 2158 | |
2165 | 2159 | if ( !$forum_id = groups_get_groupmeta( $groups_template->group->id, 'forum_id' ) ) { |
… |
… |
function bp_group_member_promote_mod_link( $args = '' ) { |
2605 | 2599 | function bp_get_group_member_promote_mod_link( $args = '' ) { |
2606 | 2600 | global $members_template, $groups_template; |
2607 | 2601 | |
2608 | | $defaults = array( |
| 2602 | $r = bp_parse_args( $args, array( |
2609 | 2603 | 'user_id' => $members_template->member->user_id, |
2610 | 2604 | 'group' => &$groups_template->group |
2611 | | ); |
2612 | | |
2613 | | $r = wp_parse_args( $args, $defaults ); |
| 2605 | ), 'group_member_promote_mod_link' ); |
2614 | 2606 | extract( $r, EXTR_SKIP ); |
2615 | 2607 | |
2616 | 2608 | /** |
… |
… |
function bp_group_member_promote_admin_link( $args = '' ) { |
2648 | 2640 | function bp_get_group_member_promote_admin_link( $args = '' ) { |
2649 | 2641 | global $members_template, $groups_template; |
2650 | 2642 | |
2651 | | $defaults = array( |
| 2643 | $r = bp_parse_args( $args, array( |
2652 | 2644 | 'user_id' => !empty( $members_template->member->user_id ) ? $members_template->member->user_id : false, |
2653 | 2645 | 'group' => &$groups_template->group |
2654 | | ); |
2655 | | |
2656 | | $r = wp_parse_args( $args, $defaults ); |
| 2646 | ), 'group_member_promote_admin_link' ); |
2657 | 2647 | extract( $r, EXTR_SKIP ); |
2658 | 2648 | |
2659 | 2649 | /** |
… |
… |
function bp_group_has_members( $args = '' ) { |
3888 | 3878 | $search_terms_default = stripslashes( $_REQUEST[ $search_query_arg ] ); |
3889 | 3879 | } |
3890 | 3880 | |
3891 | | $r = wp_parse_args( $args, array( |
| 3881 | $r = bp_parse_args( $args, array( |
3892 | 3882 | 'group_id' => bp_get_current_group_id(), |
3893 | 3883 | 'page' => 1, |
3894 | 3884 | 'per_page' => 20, |
… |
… |
function bp_group_has_members( $args = '' ) { |
3899 | 3889 | 'group_role' => false, |
3900 | 3890 | 'search_terms' => $search_terms_default, |
3901 | 3891 | 'type' => 'last_joined', |
3902 | | ) ); |
| 3892 | ), 'group_has_members' ); |
3903 | 3893 | |
3904 | 3894 | /* |
3905 | 3895 | * If an empty search_terms string has been passed, |
… |
… |
function bp_group_member_joined_since( $args = array() ) { |
4274 | 4264 | function bp_get_group_member_joined_since( $args = array() ) { |
4275 | 4265 | global $members_template; |
4276 | 4266 | |
4277 | | $r = wp_parse_args( $args, array( |
| 4267 | $r = bp_parse_args( $args, array( |
4278 | 4268 | 'relative' => true, |
4279 | | ) ); |
| 4269 | ), 'group_member_joined_since' ); |
4280 | 4270 | |
4281 | 4271 | // We do not want relative time, so return now. |
4282 | 4272 | // @todo Should the 'bp_get_group_member_joined_since' filter be applied here? |
… |
… |
function bp_new_group_invite_friend_list( $args = array() ) { |
5213 | 5203 | } |
5214 | 5204 | |
5215 | 5205 | // Parse arguments. |
5216 | | $r = wp_parse_args( $args, array( |
| 5206 | $r = bp_parse_args( $args, array( |
5217 | 5207 | 'user_id' => bp_loggedin_user_id(), |
5218 | 5208 | 'group_id' => false, |
5219 | 5209 | 'separator' => 'li' |
5220 | | ) ); |
| 5210 | ), 'group_invite_friend_list' ); |
5221 | 5211 | |
5222 | 5212 | // No group passed, so look for new or current group ID's. |
5223 | 5213 | if ( empty( $r['group_id'] ) ) { |
… |
… |
function bp_custom_group_fields() { |
5565 | 5555 | function bp_group_has_membership_requests( $args = '' ) { |
5566 | 5556 | global $requests_template; |
5567 | 5557 | |
5568 | | $defaults = array( |
| 5558 | $r = bp_parse_args( $args, array( |
5569 | 5559 | 'group_id' => bp_get_current_group_id(), |
5570 | 5560 | 'per_page' => 10, |
5571 | 5561 | 'page' => 1, |
5572 | 5562 | 'max' => false |
5573 | | ); |
5574 | | |
5575 | | $r = wp_parse_args( $args, $defaults ); |
| 5563 | ), 'group_has_membership_requests' ); |
5576 | 5564 | |
5577 | 5565 | $requests_template = new BP_Groups_Membership_Requests_Template( $r ); |
5578 | 5566 | |
… |
… |
function bp_group_requests_pagination_count() { |
5814 | 5802 | function bp_group_has_invites( $args = '' ) { |
5815 | 5803 | global $invites_template, $group_id; |
5816 | 5804 | |
5817 | | $r = wp_parse_args( $args, array( |
| 5805 | $r = bp_parse_args( $args, array( |
5818 | 5806 | 'group_id' => false, |
5819 | 5807 | 'user_id' => bp_loggedin_user_id(), |
5820 | 5808 | 'per_page' => false, |
5821 | 5809 | 'page' => 1, |
5822 | | ) ); |
| 5810 | ), 'group_has_invites' ); |
5823 | 5811 | |
5824 | 5812 | if ( empty( $r['group_id'] ) ) { |
5825 | 5813 | if ( groups_get_current_group() ) { |
diff --git src/bp-groups/classes/class-bp-group-member-query.php src/bp-groups/classes/class-bp-group-member-query.php
index cec4a7c..7faa980 100644
|
|
class BP_Group_Member_Query extends BP_User_Query { |
88 | 88 | // We loop through to make sure that defaults are set (though |
89 | 89 | // values passed to the constructor will, as usual, override |
90 | 90 | // these defaults). |
91 | | $this->query_vars = wp_parse_args( $this->query_vars, array( |
| 91 | $this->query_vars = bp_parse_args( $this->query_vars, array( |
92 | 92 | 'group_id' => 0, |
93 | 93 | 'group_role' => array( 'member' ), |
94 | 94 | 'is_confirmed' => true, |
95 | 95 | 'invite_sent' => null, |
96 | 96 | 'inviter_id' => null, |
97 | 97 | 'type' => 'last_joined', |
98 | | ) ); |
| 98 | ), 'group_member_ids' ); |
99 | 99 | |
100 | 100 | $group_member_ids = $this->get_group_member_ids(); |
101 | 101 | |
diff --git src/bp-groups/classes/class-bp-groups-group-members-template.php src/bp-groups/classes/class-bp-groups-group-members-template.php
index 8b25d75..78df766 100644
|
|
class BP_Groups_Group_Members_Template { |
111 | 111 | $args = bp_core_parse_args_array( $old_args_keys, func_get_args() ); |
112 | 112 | } |
113 | 113 | |
114 | | $r = wp_parse_args( $args, array( |
| 114 | $r = bp_parse_args( $args, array( |
115 | 115 | 'group_id' => bp_get_current_group_id(), |
116 | 116 | 'page' => 1, |
117 | 117 | 'per_page' => 20, |
… |
… |
class BP_Groups_Group_Members_Template { |
123 | 123 | 'group_role' => false, |
124 | 124 | 'search_terms' => false, |
125 | 125 | 'type' => 'last_joined', |
126 | | ) ); |
| 126 | ), 'group_members_template' ); |
127 | 127 | |
128 | 128 | $this->pag_arg = sanitize_key( $r['page_arg'] ); |
129 | 129 | $this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $r['page'] ); |
diff --git src/bp-groups/classes/class-bp-groups-group.php src/bp-groups/classes/class-bp-groups-group.php
index 1c243bd..61f94f3 100644
|
|
class BP_Groups_Group { |
1078 | 1078 | 'status' => array() |
1079 | 1079 | ); |
1080 | 1080 | |
1081 | | $r = wp_parse_args( $args, $defaults ); |
| 1081 | $r = bp_parse_args( $args, $defaults, 'bp_groups_group_get' ); |
1082 | 1082 | |
1083 | 1083 | $bp = buddypress(); |
1084 | 1084 | |
diff --git src/bp-groups/classes/class-bp-groups-invite-template.php src/bp-groups/classes/class-bp-groups-invite-template.php
index 6498cd4..0d16db8 100644
|
|
class BP_Groups_Invite_Template { |
91 | 91 | $args = bp_core_parse_args_array( $old_args_keys, func_get_args() ); |
92 | 92 | } |
93 | 93 | |
94 | | $r = wp_parse_args( $args, array( |
| 94 | $r = bp_parse_args( $args, array( |
95 | 95 | 'page' => 1, |
96 | 96 | 'per_page' => 10, |
97 | 97 | 'page_arg' => 'invitepage', |
98 | 98 | 'user_id' => bp_loggedin_user_id(), |
99 | 99 | 'group_id' => bp_get_current_group_id(), |
100 | | ) ); |
| 100 | ), 'groups_invite_template' ); |
101 | 101 | |
102 | 102 | $this->pag_arg = sanitize_key( $r['page_arg'] ); |
103 | 103 | $this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $r['page'] ); |
diff --git src/bp-groups/classes/class-bp-groups-membership-requests-template.php src/bp-groups/classes/class-bp-groups-membership-requests-template.php
index b0a011a..3a9c2f6 100644
|
|
class BP_Groups_Membership_Requests_Template { |
99 | 99 | $args = bp_core_parse_args_array( $old_args_keys, func_get_args() ); |
100 | 100 | } |
101 | 101 | |
102 | | $r = wp_parse_args( $args, array( |
| 102 | $r = bp_parse_args( $args, array( |
103 | 103 | 'page' => 1, |
104 | 104 | 'per_page' => 10, |
105 | 105 | 'page_arg' => 'mrpage', |
106 | 106 | 'max' => false, |
107 | 107 | 'type' => 'first_joined', |
108 | 108 | 'group_id' => bp_get_current_group_id(), |
109 | | ) ); |
| 109 | ), 'group_membership_requests_template' ); |
110 | 110 | |
111 | 111 | $this->pag_arg = sanitize_key( $r['page_arg'] ); |
112 | 112 | $this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $r['page'] ); |
diff --git src/bp-groups/classes/class-bp-groups-template.php src/bp-groups/classes/class-bp-groups-template.php
index ba5e412..f6483cd 100644
|
|
class BP_Groups_Template { |
175 | 175 | 'update_admin_cache' => false, |
176 | 176 | ); |
177 | 177 | |
178 | | $r = wp_parse_args( $args, $defaults ); |
| 178 | $r = bp_parse_args( $args, $defaults, 'bp_groups_template' ); |
179 | 179 | extract( $r ); |
180 | 180 | |
181 | 181 | $this->pag_arg = sanitize_key( $r['page_arg'] ); |
diff --git src/bp-groups/classes/class-bp-groups-widget.php src/bp-groups/classes/class-bp-groups-widget.php
index 049ab31..d18301f 100644
|
|
class BP_Groups_Widget extends WP_Widget { |
206 | 206 | 'group_default' => 'active', |
207 | 207 | 'link_title' => false |
208 | 208 | ); |
209 | | $instance = wp_parse_args( (array) $instance, $defaults ); |
| 209 | $instance = bp_parse_args( (array) $instance, $defaults, 'groups_widget_form' ); |
210 | 210 | |
211 | 211 | $title = strip_tags( $instance['title'] ); |
212 | 212 | $max_groups = strip_tags( $instance['max_groups'] ); |