-
diff --git src/bp-activity/bp-activity-blocks.php src/bp-activity/bp-activity-blocks.php
index 9b40e5739..1e60e0f58 100644
|
|
if ( ! defined( 'ABSPATH' ) ) { |
21 | 21 | * @return string HTML output. |
22 | 22 | */ |
23 | 23 | function bp_activity_render_latest_activities_block( $attributes = array() ) { |
24 | | $block_args = wp_parse_args( |
| 24 | $block_args = bp_parse_args( |
25 | 25 | $attributes, |
26 | 26 | array( |
27 | 27 | 'title' => __( 'Latest updates', 'buddypress' ), |
-
diff --git src/bp-activity/bp-activity-filters.php src/bp-activity/bp-activity-filters.php
index 064614a97..a47e0b647 100644
|
|
function bp_activity_truncate_entry( $text, $args = array() ) { |
439 | 439 | |
440 | 440 | $excerpt_length = bp_activity_get_excerpt_length(); |
441 | 441 | |
442 | | $args = wp_parse_args( $args, array( 'ending' => __( '…', 'buddypress' ) ) ); |
| 442 | $args = bp_parse_args( $args, array( 'ending' => __( '…', 'buddypress' ) ) ); |
443 | 443 | |
444 | 444 | // Run the text through the excerpt function. If it's too short, the original text will be returned. |
445 | 445 | $excerpt = bp_create_excerpt( $text, $excerpt_length, $args ); |
-
diff --git src/bp-activity/bp-activity-functions.php src/bp-activity/bp-activity-functions.php
index cf9410657..f7c5cec1e 100644
|
|
function bp_activity_add( $args = '' ) { |
2021 | 2021 | */ |
2022 | 2022 | function bp_activity_post_update( $args = '' ) { |
2023 | 2023 | |
2024 | | $r = wp_parse_args( $args, array( |
| 2024 | $r = bp_parse_args( $args, array( |
2025 | 2025 | 'content' => false, |
2026 | 2026 | 'user_id' => bp_loggedin_user_id(), |
2027 | 2027 | 'error_type' => 'bool', |
… |
… |
add_action( 'delete_comment', 'bp_activity_post_type_remove_comment', 10, 1 ); |
2646 | 2646 | function bp_activity_new_comment( $args = '' ) { |
2647 | 2647 | $bp = buddypress(); |
2648 | 2648 | |
2649 | | $r = wp_parse_args( $args, array( |
| 2649 | $r = bp_parse_args( $args, array( |
2650 | 2650 | 'id' => false, |
2651 | 2651 | 'content' => false, |
2652 | 2652 | 'user_id' => bp_loggedin_user_id(), |
-
diff --git src/bp-activity/bp-activity-template.php src/bp-activity/bp-activity-template.php
index f59004e89..a6de4c8b7 100644
|
|
function bp_activity_avatar( $args = '' ) { |
1049 | 1049 | 'user_id' => false |
1050 | 1050 | ); |
1051 | 1051 | |
1052 | | $r = wp_parse_args( $args, $defaults ); |
| 1052 | $r = bp_parse_args( $args, $defaults ); |
1053 | 1053 | extract( $r, EXTR_SKIP ); |
1054 | 1054 | |
1055 | 1055 | if ( !isset( $height ) && !isset( $width ) ) { |
… |
… |
function bp_activity_secondary_avatar( $args = '' ) { |
1152 | 1152 | function bp_get_activity_secondary_avatar( $args = '' ) { |
1153 | 1153 | global $activities_template; |
1154 | 1154 | |
1155 | | $r = wp_parse_args( $args, array( |
| 1155 | $r = bp_parse_args( $args, array( |
1156 | 1156 | 'alt' => '', |
1157 | 1157 | 'type' => 'thumb', |
1158 | 1158 | 'width' => 20, |
… |
… |
function bp_activity_action( $args = array() ) { |
1328 | 1328 | function bp_get_activity_action( $args = array() ) { |
1329 | 1329 | global $activities_template; |
1330 | 1330 | |
1331 | | $r = wp_parse_args( $args, array( |
| 1331 | $r = bp_parse_args( $args, array( |
1332 | 1332 | 'no_timestamp' => false, |
1333 | 1333 | ) ); |
1334 | 1334 | |
… |
… |
function bp_activity_filter_links( $args = false ) { |
2812 | 2812 | */ |
2813 | 2813 | function bp_get_activity_filter_links( $args = false ) { |
2814 | 2814 | |
2815 | | $r = wp_parse_args( $args, array( |
| 2815 | $r = bp_parse_args( $args, array( |
2816 | 2816 | 'style' => 'list' |
2817 | 2817 | ) ); |
2818 | 2818 | |
-
diff --git src/bp-activity/classes/class-bp-activity-activity.php src/bp-activity/classes/class-bp-activity-activity.php
index 840b90152..7bfc1ac00 100644
|
|
class BP_Activity_Activity { |
413 | 413 | } |
414 | 414 | |
415 | 415 | $bp = buddypress(); |
416 | | $r = wp_parse_args( $args, array( |
| 416 | $r = bp_parse_args( $args, array( |
417 | 417 | 'page' => 1, // The current page. |
418 | 418 | 'per_page' => 25, // Activity items per page. |
419 | 419 | 'max' => false, // Max number of items to return. |
… |
… |
class BP_Activity_Activity { |
1257 | 1257 | global $wpdb; |
1258 | 1258 | |
1259 | 1259 | $bp = buddypress(); |
1260 | | $r = wp_parse_args( $args, array( |
| 1260 | $r = bp_parse_args( $args, array( |
1261 | 1261 | 'id' => false, |
1262 | 1262 | 'action' => false, |
1263 | 1263 | 'content' => false, |
-
diff --git src/bp-activity/classes/class-bp-activity-feed.php src/bp-activity/classes/class-bp-activity-feed.php
index 8b2388a22..9e6064d2e 100644
|
|
class BP_Activity_Feed { |
104 | 104 | ); |
105 | 105 | } else { |
106 | 106 | // Setup data. |
107 | | $this->data = wp_parse_args( $args, array( |
| 107 | $this->data = bp_parse_args( $args, array( |
108 | 108 | // Internal identifier for the RSS feed - should be alphanumeric only. |
109 | 109 | 'id' => '', |
110 | 110 | |
… |
… |
class BP_Activity_Feed { |
196 | 196 | $this->update_period = strip_tags( $this->update_period ); |
197 | 197 | $this->update_frequency = (int) $this->update_frequency; |
198 | 198 | |
199 | | $this->activity_args = wp_parse_args( $this->activity_args, array( |
| 199 | $this->activity_args = bp_parse_args( $this->activity_args, array( |
200 | 200 | 'max' => $this->max, |
201 | 201 | 'per_page' => $this->max, |
202 | 202 | 'display_comments' => 'stream' |
-
diff --git src/bp-activity/classes/class-bp-activity-template.php src/bp-activity/classes/class-bp-activity-template.php
index cfc66d3bd..2c91eebd6 100644
|
|
class BP_Activity_Template { |
186 | 186 | 'spam' => 'ham_only', |
187 | 187 | 'update_meta_cache' => true, |
188 | 188 | ); |
189 | | $r = wp_parse_args( $args, $defaults ); |
| 189 | $r = bp_parse_args( $args, $defaults ); |
190 | 190 | extract( $r ); |
191 | 191 | |
192 | 192 | $this->pag_arg = sanitize_key( $r['page_arg'] ); |
-
diff --git src/bp-blogs/bp-blogs-activity.php src/bp-blogs/bp-blogs-activity.php
index 24185e3e8..c695802ee 100644
|
|
function bp_blogs_record_activity( $args = '' ) { |
478 | 478 | 'hide_sitewide' => false |
479 | 479 | ); |
480 | 480 | |
481 | | $r = wp_parse_args( $args, $defaults ); |
| 481 | $r = bp_parse_args( $args, $defaults ); |
482 | 482 | |
483 | 483 | if ( ! empty( $r['action'] ) ) { |
484 | 484 | |
-
diff --git src/bp-blogs/bp-blogs-blocks.php src/bp-blogs/bp-blogs-blocks.php
index 47bf94596..dd7eadc42 100644
|
|
if ( ! defined( 'ABSPATH' ) ) { |
21 | 21 | * @return string HTML output. |
22 | 22 | */ |
23 | 23 | function bp_blogs_render_recent_posts_block( $attributes = array() ) { |
24 | | $block_args = wp_parse_args( |
| 24 | $block_args = bp_parse_args( |
25 | 25 | $attributes, |
26 | 26 | array( |
27 | 27 | 'title' => __( 'Recent Networkwide Posts', 'buddypress' ), |
-
diff --git src/bp-blogs/bp-blogs-functions.php src/bp-blogs/bp-blogs-functions.php
index b27de8ac1..870062e2b 100644
|
|
function bp_blogs_get_signup_form_submitted_vars() { |
1531 | 1531 | 'blog_public' => 0, |
1532 | 1532 | ); |
1533 | 1533 | |
1534 | | $submitted_vars = wp_parse_args( $_POST, $exprected_vars ); |
| 1534 | $submitted_vars = bp_parse_args( $_POST, $exprected_vars ); |
1535 | 1535 | |
1536 | 1536 | return array_map( 'wp_unslash', array_intersect_key( $submitted_vars, $exprected_vars ) ); |
1537 | 1537 | } |
-
diff --git src/bp-blogs/bp-blogs-template.php src/bp-blogs/bp-blogs-template.php
index ac4dd83a7..7f2e8b924 100644
|
|
function bp_blog_latest_post( $args = array() ) { |
687 | 687 | function bp_get_blog_latest_post( $args = array() ) { |
688 | 688 | global $blogs_template; |
689 | 689 | |
690 | | $r = wp_parse_args( $args, array( |
| 690 | $r = bp_parse_args( $args, array( |
691 | 691 | 'latest_format' => true, |
692 | 692 | ) ); |
693 | 693 | |
… |
… |
function bp_blogs_visit_blog_button( $args = '' ) { |
1559 | 1559 | 'link_text' => __( 'Visit Site', 'buddypress' ), |
1560 | 1560 | ); |
1561 | 1561 | |
1562 | | $button = wp_parse_args( $args, $defaults ); |
| 1562 | $button = bp_parse_args( $args, $defaults ); |
1563 | 1563 | |
1564 | 1564 | /** |
1565 | 1565 | * Filters the button for visiting a blog in a loop. |
-
diff --git src/bp-blogs/classes/class-bp-blogs-recent-posts-widget.php src/bp-blogs/classes/class-bp-blogs-recent-posts-widget.php
index e71e88fff..9974e60b8 100644
|
|
class BP_Blogs_Recent_Posts_Widget extends WP_Widget { |
154 | 154 | * @return void |
155 | 155 | */ |
156 | 156 | public function form( $instance ) { |
157 | | $instance = wp_parse_args( (array) $instance, array( |
| 157 | $instance = bp_parse_args( (array) $instance, array( |
158 | 158 | 'title' => __( 'Recent Networkwide Posts', 'buddypress' ), |
159 | 159 | 'max_posts' => 10, |
160 | 160 | 'link_title' => false, |
-
diff --git src/bp-core/admin/bp-core-admin-types.php src/bp-core/admin/bp-core-admin-types.php
index 6b8db3f7a..6f8095c4a 100644
|
|
function bp_core_admin_update_type( $args = array() ) { |
181 | 181 | $metadata = bp_core_admin_get_type_default_meta_values( $type_taxonomy ); |
182 | 182 | |
183 | 183 | // Merge customs with defaults. |
184 | | $metas = wp_parse_args( $args, $metadata ); |
| 184 | $metas = bp_parse_args( $args, $metadata ); |
185 | 185 | |
186 | 186 | // Validate metadata |
187 | 187 | $metas = array_intersect_key( $metas, $metadata ); |
-
diff --git src/bp-core/bp-core-attachments.php src/bp-core/bp-core-attachments.php
index cf4321c6a..be5e58259 100644
|
|
function bp_attachments_get_cover_image_settings( $component = 'members' ) { |
1021 | 1021 | } |
1022 | 1022 | |
1023 | 1023 | // Set default args. |
1024 | | $default_args = wp_parse_args( |
| 1024 | $default_args = bp_parse_args( |
1025 | 1025 | $args, |
1026 | 1026 | array( |
1027 | 1027 | 'components' => array(), |
-
diff --git src/bp-core/bp-core-avatars.php src/bp-core/bp-core-avatars.php
index 3ffa26d12..8d0e3e6a5 100644
|
|
function bp_core_fetch_avatar( $args = '' ) { |
231 | 231 | } |
232 | 232 | |
233 | 233 | // Set the default variables array and parse it against incoming $args array. |
234 | | $params = wp_parse_args( $args, array( |
| 234 | $params = bp_parse_args( $args, array( |
235 | 235 | 'item_id' => false, |
236 | 236 | 'object' => 'user', |
237 | 237 | 'type' => 'thumb', |
… |
… |
function bp_core_delete_existing_avatar( $args = '' ) { |
765 | 765 | 'avatar_dir' => false |
766 | 766 | ); |
767 | 767 | |
768 | | $args = wp_parse_args( $args, $defaults ); |
| 768 | $args = bp_parse_args( $args, $defaults ); |
769 | 769 | |
770 | 770 | /** |
771 | 771 | * Filters whether or not to handle deleting an existing avatar. |
… |
… |
function bp_avatar_handle_capture( $data = '', $item_id = 0 ) { |
1254 | 1254 | */ |
1255 | 1255 | function bp_core_avatar_handle_crop( $args = '' ) { |
1256 | 1256 | |
1257 | | $r = wp_parse_args( $args, array( |
| 1257 | $r = bp_parse_args( $args, array( |
1258 | 1258 | 'object' => 'user', |
1259 | 1259 | 'avatar_dir' => 'avatars', |
1260 | 1260 | 'item_id' => false, |
… |
… |
function bp_avatar_ajax_set() { |
1307 | 1307 | // Check the nonce. |
1308 | 1308 | check_admin_referer( 'bp_avatar_cropstore', 'nonce' ); |
1309 | 1309 | |
1310 | | $avatar_data = wp_parse_args( $_POST, array( |
| 1310 | $avatar_data = bp_parse_args( $_POST, array( |
1311 | 1311 | 'crop_w' => bp_core_avatar_full_width(), |
1312 | 1312 | 'crop_h' => bp_core_avatar_full_height(), |
1313 | 1313 | 'crop_x' => 0, |
-
diff --git src/bp-core/bp-core-blocks.php src/bp-core/bp-core-blocks.php
index 94e485dbc..7e5f8d2bd 100644
|
|
function bp_blocks_get_login_widget_registration_link( $content = '', $args = ar |
257 | 257 | * @return string HTML output. |
258 | 258 | */ |
259 | 259 | function bp_block_render_login_form_block( $attributes = array() ) { |
260 | | $block_args = wp_parse_args( |
| 260 | $block_args = bp_parse_args( |
261 | 261 | $attributes, |
262 | 262 | array( |
263 | 263 | 'title' => '', |
-
diff --git src/bp-core/bp-core-buddybar.php src/bp-core/bp-core-buddybar.php
index 336a52ad8..54ee372d2 100644
|
|
function bp_core_new_nav_item( $args, $component = 'members' ) { |
53 | 53 | 'default_subnav_slug' => false // The slug of the default subnav item to select when clicked. |
54 | 54 | ); |
55 | 55 | |
56 | | $r = wp_parse_args( $args, $defaults ); |
| 56 | $r = bp_parse_args( $args, $defaults ); |
57 | 57 | |
58 | 58 | // Validate nav link data. |
59 | 59 | $nav_item = bp_core_create_nav_link( $r, $component ); |
… |
… |
function bp_core_create_nav_link( $args = '', $component = 'members' ) { |
130 | 130 | 'default_subnav_slug' => false // The slug of the default subnav item to select when clicked. |
131 | 131 | ); |
132 | 132 | |
133 | | $r = wp_parse_args( $args, $defaults ); |
| 133 | $r = bp_parse_args( $args, $defaults ); |
134 | 134 | |
135 | 135 | // If we don't have the required info we need, don't create this nav item. |
136 | 136 | if ( empty( $r['name'] ) || empty( $r['slug'] ) ) { |
… |
… |
function bp_core_register_nav_screen_function( $args = '' ) { |
217 | 217 | 'default_subnav_slug' => false // The slug of the default subnav item to select when clicked. |
218 | 218 | ); |
219 | 219 | |
220 | | $r = wp_parse_args( $args, $defaults ); |
| 220 | $r = bp_parse_args( $args, $defaults ); |
221 | 221 | |
222 | 222 | // If we don't have the required info we need, don't register this screen function. |
223 | 223 | if ( empty( $r['slug'] ) ) { |
… |
… |
function bp_core_new_nav_default( $args = '' ) { |
314 | 314 | 'subnav_slug' => false // The slug of the subnav item to select when clicked. |
315 | 315 | ); |
316 | 316 | |
317 | | $r = wp_parse_args( $args, $defaults ); |
| 317 | $r = bp_parse_args( $args, $defaults ); |
318 | 318 | |
319 | 319 | // This is specific to Members - it's not available in Groups. |
320 | 320 | $parent_nav = $bp->members->nav->get_primary( array( 'slug' => $r['parent_slug'] ), false ); |
… |
… |
function bp_core_new_subnav_item( $args, $component = null ) { |
529 | 529 | function bp_core_create_subnav_link( $args = '', $component = 'members' ) { |
530 | 530 | $bp = buddypress(); |
531 | 531 | |
532 | | $r = wp_parse_args( $args, array( |
| 532 | $r = bp_parse_args( $args, array( |
533 | 533 | 'name' => false, // Display name for the nav item. |
534 | 534 | 'slug' => false, // URL slug for the nav item. |
535 | 535 | 'parent_slug' => false, // URL slug of the parent nav item. |
… |
… |
function bp_core_create_subnav_link( $args = '', $component = 'members' ) { |
625 | 625 | function bp_core_register_subnav_screen_function( $args = '', $component = 'members' ) { |
626 | 626 | $bp = buddypress(); |
627 | 627 | |
628 | | $r = wp_parse_args( $args, array( |
| 628 | $r = bp_parse_args( $args, array( |
629 | 629 | 'slug' => false, // URL slug for the screen. |
630 | 630 | 'parent_slug' => false, // URL slug of the parent screen. |
631 | 631 | 'user_has_access' => true, // Can the user visit this screen? |
-
diff --git src/bp-core/bp-core-cache.php src/bp-core/bp-core-cache.php
index 35d381a50..0fcf58458 100644
|
|
function bp_update_meta_cache( $args = array() ) { |
207 | 207 | 'object_column' => '', // DB column for the object ids (group_id, etc). |
208 | 208 | 'cache_key_prefix' => '' // Prefix to use when creating cache key names. Eg 'bp_groups_groupmeta'. |
209 | 209 | ); |
210 | | $r = wp_parse_args( $args, $defaults ); |
| 210 | $r = bp_parse_args( $args, $defaults ); |
211 | 211 | extract( $r ); |
212 | 212 | |
213 | 213 | if ( empty( $object_ids ) || empty( $object_type ) || empty( $meta_table ) || empty( $cache_group ) ) { |
-
diff --git src/bp-core/bp-core-catchuri.php src/bp-core/bp-core-catchuri.php
index df857d464..9717437c4 100644
|
|
function bp_core_no_access( $args = '' ) { |
643 | 643 | 'message' => __( 'You must log in to access the page you requested.', 'buddypress' ) |
644 | 644 | ); |
645 | 645 | |
646 | | $r = wp_parse_args( $args, $defaults ); |
| 646 | $r = bp_parse_args( $args, $defaults ); |
647 | 647 | |
648 | 648 | /** |
649 | 649 | * Filters the arguments used for user redirecting when visiting access controlled areas. |
… |
… |
function bp_get_canonical_url( $args = array() ) { |
875 | 875 | $defaults = array( |
876 | 876 | 'include_query_args' => false // Include URL arguments, eg ?foo=bar&foo2=bar2. |
877 | 877 | ); |
878 | | $r = wp_parse_args( $args, $defaults ); |
| 878 | $r = bp_parse_args( $args, $defaults ); |
879 | 879 | extract( $r ); |
880 | 880 | |
881 | 881 | // Special case: when a BuddyPress directory (eg example.com/members) |
-
diff --git src/bp-core/bp-core-functions.php src/bp-core/bp-core-functions.php
index 066e7a25f..e62968fd7 100644
|
|
function bp_core_number_format( $number = 0, $decimals = false ) { |
230 | 230 | * 'arg3' => array(), |
231 | 231 | * 'arg4' => false, |
232 | 232 | * ); |
233 | | * $r = wp_parse_args( $args, $defaults ); // ... |
| 233 | * $r = bp_parse_args( $args, $defaults ); // ... |
234 | 234 | * |
235 | 235 | * The first argument, $old_args_keys, is an array that matches the parameter positions (keys) to |
236 | 236 | * the new $args keys (values): |
… |
… |
function bp_parse_args( $args, $defaults = array(), $filter_key = '' ) { |
290 | 290 | } |
291 | 291 | |
292 | 292 | // Passively filter the args before the parse. |
293 | | if ( !empty( $filter_key ) ) { |
| 293 | if ( ! empty( $filter_key ) ) { |
294 | 294 | |
295 | 295 | /** |
296 | 296 | * Filters the arguments key before parsing if filter key provided. |
… |
… |
function bp_parse_args( $args, $defaults = array(), $filter_key = '' ) { |
305 | 305 | } |
306 | 306 | |
307 | 307 | // Parse. |
308 | | if ( is_array( $defaults ) && !empty( $defaults ) ) { |
| 308 | if ( is_array( $defaults ) && ! empty( $defaults ) ) { |
309 | 309 | $r = array_merge( $defaults, $r ); |
310 | 310 | } |
311 | 311 | |
312 | 312 | // Aggressively filter the args after the parse. |
313 | | if ( !empty( $filter_key ) ) { |
| 313 | if ( ! empty( $filter_key ) ) { |
314 | 314 | |
315 | 315 | /** |
316 | 316 | * Filters the arguments key after parsing if filter key provided. |
… |
… |
function bp_core_current_time( $gmt = true, $type = 'mysql' ) { |
1195 | 1195 | */ |
1196 | 1196 | function bp_core_time_diff( $args = array() ) { |
1197 | 1197 | $retval = null; |
1198 | | $r = wp_parse_args( |
| 1198 | $r = bp_parse_args( |
1199 | 1199 | $args, |
1200 | 1200 | array( |
1201 | 1201 | 'older_date' => 0, |
-
diff --git src/bp-core/bp-core-template.php src/bp-core/bp-core-template.php
index 0961c0805..2145146a4 100644
|
|
function bp_nav_menu( $args = array() ) { |
3671 | 3671 | 'menu_id' => '', |
3672 | 3672 | 'walker' => '', |
3673 | 3673 | ); |
3674 | | $args = wp_parse_args( $args, $defaults ); |
| 3674 | $args = bp_parse_args( $args, $defaults ); |
3675 | 3675 | |
3676 | 3676 | /** |
3677 | 3677 | * Filters the parsed bp_nav_menu arguments. |
-
diff --git src/bp-core/bp-core-theme-compatibility.php src/bp-core/bp-core-theme-compatibility.php
index f6a40e22b..12e39a745 100644
|
|
function bp_theme_compat_reset_post( $args = array() ) { |
549 | 549 | |
550 | 550 | // Switch defaults if post is set. |
551 | 551 | if ( isset( $wp_query->post ) ) { |
552 | | $dummy = wp_parse_args( $args, array( |
| 552 | $dummy = bp_parse_args( $args, array( |
553 | 553 | 'ID' => $wp_query->post->ID, |
554 | 554 | 'post_status' => $wp_query->post->post_status, |
555 | 555 | 'post_author' => $wp_query->post->post_author, |
… |
… |
function bp_theme_compat_reset_post( $args = array() ) { |
582 | 582 | 'is_tax' => false, |
583 | 583 | ) ); |
584 | 584 | } else { |
585 | | $dummy = wp_parse_args( $args, array( |
| 585 | $dummy = bp_parse_args( $args, array( |
586 | 586 | 'ID' => -9999, |
587 | 587 | 'post_status' => 'public', |
588 | 588 | 'post_author' => 0, |
-
diff --git src/bp-core/classes/class-bp-button.php src/bp-core/classes/class-bp-button.php
index 35785ef99..b545078cb 100644
|
|
class BP_Button { |
236 | 236 | */ |
237 | 237 | public function __construct( $args = '' ) { |
238 | 238 | |
239 | | $r = wp_parse_args( $args, get_class_vars( __CLASS__ ) ); |
| 239 | $r = bp_parse_args( $args, get_class_vars( __CLASS__ ) ); |
240 | 240 | |
241 | 241 | // Backward compatibility with deprecated parameters. |
242 | 242 | $r = $this->backward_compatibility_args( $r ); |
-
diff --git src/bp-core/classes/class-bp-component.php src/bp-core/classes/class-bp-component.php
index 626fa2fcf..c8dd8062c 100644
|
|
class BP_Component { |
234 | 234 | * } |
235 | 235 | */ |
236 | 236 | public function setup_globals( $args = array() ) { |
237 | | $r = wp_parse_args( $args, array( |
| 237 | $r = bp_parse_args( $args, array( |
238 | 238 | 'slug' => $this->id, |
239 | 239 | 'root_slug' => '', |
240 | 240 | 'has_directory' => false, |
-
diff --git src/bp-core/classes/class-bp-core-login-widget.php src/bp-core/classes/class-bp-core-login-widget.php
index b9c66cbd9..c76df85c5 100644
|
|
class BP_Core_Login_Widget extends WP_Widget { |
174 | 174 | */ |
175 | 175 | public function form( $instance = array() ) { |
176 | 176 | |
177 | | $settings = wp_parse_args( $instance, array( |
| 177 | $settings = bp_parse_args( $instance, array( |
178 | 178 | 'title' => '', |
179 | 179 | ) ); ?> |
180 | 180 | |
-
diff --git src/bp-core/classes/class-bp-core-nav.php src/bp-core/classes/class-bp-core-nav.php
index 634ddcbb1..8d8024389 100644
|
|
class BP_Core_Nav { |
176 | 176 | } |
177 | 177 | |
178 | 178 | $nav_item = reset( $nav_items ); |
179 | | $this->nav[ $this->object_id ][ $slug ] = new BP_Core_Nav_Item( wp_parse_args( $args, (array) $nav_item ) ); |
| 179 | $this->nav[ $this->object_id ][ $slug ] = new BP_Core_Nav_Item( bp_parse_args( $args, (array) $nav_item ) ); |
180 | 180 | |
181 | 181 | // Return the edited object. |
182 | 182 | return $this->nav[ $this->object_id ][ $slug ]; |
… |
… |
class BP_Core_Nav { |
191 | 191 | |
192 | 192 | $sub_item = reset( $sub_items ); |
193 | 193 | |
194 | | $params = wp_parse_args( $args, (array) $sub_item ); |
| 194 | $params = bp_parse_args( $args, (array) $sub_item ); |
195 | 195 | |
196 | 196 | // When we have parents, it's for life, we can't change them! |
197 | 197 | if ( empty( $params['parent_slug'] ) || $parent_slug !== $params['parent_slug'] ) { |
… |
… |
class BP_Core_Nav { |
325 | 325 | * @return array The list of primary objects nav |
326 | 326 | */ |
327 | 327 | public function get_primary( $args = array(), $sort = true ) { |
328 | | $params = wp_parse_args( $args, array( 'primary' => true ) ); |
| 328 | $params = bp_parse_args( $args, array( 'primary' => true ) ); |
329 | 329 | |
330 | 330 | // This parameter is not overridable. |
331 | 331 | if ( empty( $params['primary'] ) ) { |
… |
… |
class BP_Core_Nav { |
355 | 355 | * @return bool|array The list of secondary objects nav, or false if none set. |
356 | 356 | */ |
357 | 357 | public function get_secondary( $args = array(), $sort = true ) { |
358 | | $params = wp_parse_args( $args, array( 'parent_slug' => '' ) ); |
| 358 | $params = bp_parse_args( $args, array( 'parent_slug' => '' ) ); |
359 | 359 | |
360 | 360 | // No need to search children if the parent is not set. |
361 | 361 | if ( empty( $params['parent_slug'] ) && empty( $params['secondary'] ) ) { |
-
diff --git src/bp-core/classes/class-bp-core-oembed-extension.php src/bp-core/classes/class-bp-core-oembed-extension.php
index b2a480965..1ba72d44b 100644
|
|
abstract class BP_Core_oEmbed_Extension { |
367 | 367 | * @return array |
368 | 368 | */ |
369 | 369 | protected function get_oembed_response_data( $item, $width ) { |
370 | | $data = wp_parse_args( $item, array( |
| 370 | $data = bp_parse_args( $item, array( |
371 | 371 | 'version' => '1.0', |
372 | 372 | 'provider_name' => get_bloginfo( 'name' ), |
373 | 373 | 'provider_url' => get_home_url(), |
-
diff --git src/bp-core/classes/class-bp-embed.php src/bp-core/classes/class-bp-embed.php
index 4b1d160f5..a87086e34 100644
|
|
class BP_Embed extends WP_Embed { |
80 | 80 | return ''; |
81 | 81 | |
82 | 82 | $rawattr = $attr; |
83 | | $attr = wp_parse_args( $attr, wp_embed_defaults() ); |
| 83 | $attr = bp_parse_args( $attr, wp_embed_defaults() ); |
84 | 84 | |
85 | 85 | // Use kses to convert & into & and we need to undo this |
86 | 86 | // See https://core.trac.wordpress.org/ticket/11311. |
-
diff --git src/bp-core/classes/class-bp-suggestions.php src/bp-core/classes/class-bp-suggestions.php
index c222ed709..bf2198fdb 100644
|
|
abstract class BP_Suggestions { |
80 | 80 | * } |
81 | 81 | */ |
82 | 82 | public function set_query( array $args = array() ) { |
83 | | $this->args = wp_parse_args( $args, $this->default_args ); |
| 83 | $this->args = bp_parse_args( $args, $this->default_args ); |
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
-
diff --git src/bp-core/classes/class-bp-user-query.php src/bp-core/classes/class-bp-user-query.php
index 68b4fbf56..3ec5c9d22 100644
|
|
class BP_User_Query { |
154 | 154 | $this->setup_hooks(); |
155 | 155 | |
156 | 156 | if ( ! empty( $this->query_vars_raw ) ) { |
157 | | $this->query_vars = wp_parse_args( $this->query_vars_raw, array( |
| 157 | $this->query_vars = bp_parse_args( $this->query_vars_raw, array( |
158 | 158 | 'type' => 'newest', |
159 | 159 | 'per_page' => 0, |
160 | 160 | 'page' => 1, |
-
diff --git src/bp-core/deprecated/1.2.php src/bp-core/deprecated/1.2.php
index 7d520eaf3..1f5fd567e 100644
|
|
function bp_activity_get_sitewide( $args = '' ) { |
44 | 44 | 'filter' => array() |
45 | 45 | ); |
46 | 46 | |
47 | | $args = wp_parse_args( $args, $defaults ); |
| 47 | $args = bp_parse_args( $args, $defaults ); |
48 | 48 | |
49 | 49 | return apply_filters( 'bp_activity_get_sitewide', BP_Activity_Activity::get( $args ), $r ); |
50 | 50 | } |
-
diff --git src/bp-core/deprecated/1.5.php src/bp-core/deprecated/1.5.php
index 7ef75b69e..c64f99ab3 100644
|
|
function bp_core_add_admin_menu_page( $args = '' ) { |
97 | 97 | 'position' => 100 |
98 | 98 | ); |
99 | 99 | |
100 | | $r = wp_parse_args( $args, $defaults ); |
| 100 | $r = bp_parse_args( $args, $defaults ); |
101 | 101 | extract( $r, EXTR_SKIP ); |
102 | 102 | |
103 | 103 | $file = plugin_basename( $file ); |
-
diff --git src/bp-friends/bp-friends-activity.php src/bp-friends/bp-friends-activity.php
index 24efd68dd..8c872ad54 100644
|
|
function friends_record_activity( $args = '' ) { |
39 | 39 | return false; |
40 | 40 | } |
41 | 41 | |
42 | | $r = wp_parse_args( $args, array( |
| 42 | $r = bp_parse_args( $args, array( |
43 | 43 | 'user_id' => bp_loggedin_user_id(), |
44 | 44 | 'action' => '', |
45 | 45 | 'content' => '', |
-
diff --git src/bp-friends/bp-friends-blocks.php src/bp-friends/bp-friends-blocks.php
index 25a172bda..cd0d23abc 100644
|
|
function bp_friends_blocks_add_script_data() { |
44 | 44 | * @return string HTML output. |
45 | 45 | */ |
46 | 46 | function bp_friends_render_friends_block( $attributes = array() ) { |
47 | | $block_args = wp_parse_args( |
| 47 | $block_args = bp_parse_args( |
48 | 48 | $attributes, |
49 | 49 | array( |
50 | 50 | 'maxFriends' => 5, |
-
diff --git src/bp-friends/classes/class-bp-core-friends-widget.php src/bp-friends/classes/class-bp-core-friends-widget.php
index cae27828d..12dcfd594 100644
|
|
class BP_Core_Friends_Widget extends WP_Widget { |
184 | 184 | 'link_title' => false, |
185 | 185 | ); |
186 | 186 | |
187 | | $instance = wp_parse_args( (array) $instance, $defaults ); |
| 187 | $instance = bp_parse_args( (array) $instance, $defaults ); |
188 | 188 | $max_friends = $instance['max_friends']; |
189 | 189 | $friend_default = $instance['friend_default']; |
190 | 190 | $link_title = (bool) $instance['link_title']; |
-
diff --git src/bp-groups/bp-groups-blocks.php src/bp-groups/bp-groups-blocks.php
index 224d298b8..42bda3cd7 100644
|
|
if ( ! defined( 'ABSPATH' ) ) { |
23 | 23 | function bp_groups_render_group_block( $attributes = array() ) { |
24 | 24 | $bp = buddypress(); |
25 | 25 | |
26 | | $block_args = wp_parse_args( |
| 26 | $block_args = bp_parse_args( |
27 | 27 | $attributes, |
28 | 28 | array( |
29 | 29 | 'itemID' => 0, |
… |
… |
function bp_groups_render_group_block( $attributes = array() ) { |
190 | 190 | function bp_groups_render_groups_block( $attributes = array() ) { |
191 | 191 | $bp = buddypress(); |
192 | 192 | |
193 | | $block_args = wp_parse_args( |
| 193 | $block_args = bp_parse_args( |
194 | 194 | $attributes, |
195 | 195 | array( |
196 | 196 | 'itemIDs' => array(), |
… |
… |
function bp_groups_blocks_add_script_data() { |
345 | 345 | * @return string HTML output. |
346 | 346 | */ |
347 | 347 | function bp_groups_render_dynamic_groups_block( $attributes = array() ) { |
348 | | $block_args = wp_parse_args( |
| 348 | $block_args = bp_parse_args( |
349 | 349 | $attributes, |
350 | 350 | array( |
351 | 351 | 'title' => __( 'Groups', 'buddypress' ), |
-
diff --git src/bp-groups/bp-groups-template.php src/bp-groups/bp-groups-template.php
index ce3ae0a19..c391cbcd6 100644
|
|
function bp_group_type_list( $group_id = 0, $r = array() ) { |
277 | 277 | ); |
278 | 278 | } |
279 | 279 | |
280 | | $labels = wp_parse_args( |
| 280 | $labels = bp_parse_args( |
281 | 281 | $r['label'], |
282 | 282 | array( |
283 | 283 | 'plural' => __( 'Group Types:', 'buddypress' ), |
-
diff --git src/bp-members/bp-members-blocks.php src/bp-members/bp-members-blocks.php
index ae9cd93bf..cd39942ac 100644
|
|
if ( ! defined( 'ABSPATH' ) ) { |
23 | 23 | function bp_members_render_member_block( $attributes = array() ) { |
24 | 24 | $bp = buddypress(); |
25 | 25 | |
26 | | $block_args = wp_parse_args( |
| 26 | $block_args = bp_parse_args( |
27 | 27 | $attributes, |
28 | 28 | array( |
29 | 29 | 'itemID' => 0, |
… |
… |
function bp_members_render_member_block( $attributes = array() ) { |
180 | 180 | function bp_members_render_members_block( $attributes = array() ) { |
181 | 181 | $bp = buddypress(); |
182 | 182 | |
183 | | $block_args = wp_parse_args( |
| 183 | $block_args = bp_parse_args( |
184 | 184 | $attributes, |
185 | 185 | array( |
186 | 186 | 'itemIDs' => array(), |
… |
… |
function bp_members_blocks_add_script_data() { |
366 | 366 | * @return string HTML output. |
367 | 367 | */ |
368 | 368 | function bp_members_render_dynamic_members_block( $attributes = array() ) { |
369 | | $block_args = wp_parse_args( |
| 369 | $block_args = bp_parse_args( |
370 | 370 | $attributes, |
371 | 371 | array( |
372 | 372 | 'title' => __( 'Members', 'buddypress' ), |
-
diff --git src/bp-members/bp-members-template.php src/bp-members/bp-members-template.php
index 719874481..a3d8e6f76 100644
|
|
function bp_member_avatar( $args = '' ) { |
827 | 827 | 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $fullname ) |
828 | 828 | ); |
829 | 829 | |
830 | | $r = wp_parse_args( $args, $defaults ); |
| 830 | $r = bp_parse_args( $args, $defaults ); |
831 | 831 | extract( $r, EXTR_SKIP ); |
832 | 832 | |
833 | 833 | /** |
… |
… |
function bp_member_latest_update( $args = '' ) { |
1047 | 1047 | 'view_link' => true |
1048 | 1048 | ); |
1049 | 1049 | |
1050 | | $r = wp_parse_args( $args, $defaults ); |
| 1050 | $r = bp_parse_args( $args, $defaults ); |
1051 | 1051 | extract( $r ); |
1052 | 1052 | |
1053 | 1053 | if ( !bp_is_active( 'activity' ) || empty( $members_template->member->latest_update ) || !$update = maybe_unserialize( $members_template->member->latest_update ) ) |
… |
… |
function bp_member_profile_data( $args = '' ) { |
1140 | 1140 | 'user_id' => $default_user_id, |
1141 | 1141 | ); |
1142 | 1142 | |
1143 | | $r = wp_parse_args( $args, $defaults ); |
| 1143 | $r = bp_parse_args( $args, $defaults ); |
1144 | 1144 | |
1145 | 1145 | // If we're in a members loop, get the data from the global. |
1146 | 1146 | if ( ! empty( $members_template->member->profile_data ) ) { |
… |
… |
function bp_member_registered( $args = array() ) { |
1220 | 1220 | function bp_get_member_registered( $args = array() ) { |
1221 | 1221 | global $members_template; |
1222 | 1222 | |
1223 | | $r = wp_parse_args( $args, array( |
| 1223 | $r = bp_parse_args( $args, array( |
1224 | 1224 | 'relative' => true, |
1225 | 1225 | ) ); |
1226 | 1226 | |
… |
… |
function bp_loggedin_user_avatar( $args = '' ) { |
1575 | 1575 | */ |
1576 | 1576 | function bp_get_loggedin_user_avatar( $args = '' ) { |
1577 | 1577 | |
1578 | | $r = wp_parse_args( $args, array( |
| 1578 | $r = bp_parse_args( $args, array( |
1579 | 1579 | 'item_id' => bp_loggedin_user_id(), |
1580 | 1580 | 'type' => 'thumb', |
1581 | 1581 | 'width' => false, |
… |
… |
function bp_displayed_user_avatar( $args = '' ) { |
1630 | 1630 | */ |
1631 | 1631 | function bp_get_displayed_user_avatar( $args = '' ) { |
1632 | 1632 | |
1633 | | $r = wp_parse_args( $args, array( |
| 1633 | $r = bp_parse_args( $args, array( |
1634 | 1634 | 'item_id' => bp_displayed_user_id(), |
1635 | 1635 | 'type' => 'thumb', |
1636 | 1636 | 'width' => false, |
… |
… |
function bp_member_type_list( $user_id = 0, $r = array() ) { |
2153 | 2153 | // Should the label be output? |
2154 | 2154 | $has_label = ! empty( $r['label'] ); |
2155 | 2155 | |
2156 | | $labels = wp_parse_args( |
| 2156 | $labels = bp_parse_args( |
2157 | 2157 | $r['label'], |
2158 | 2158 | array( |
2159 | 2159 | 'plural' => __( 'Member Types:', 'buddypress' ), |
… |
… |
function bp_signup_avatar( $args = '' ) { |
2711 | 2711 | 'alt' => __( 'Your Profile Photo', 'buddypress' ) |
2712 | 2712 | ); |
2713 | 2713 | |
2714 | | $r = wp_parse_args( $args, $defaults ); |
| 2714 | $r = bp_parse_args( $args, $defaults ); |
2715 | 2715 | extract( $r, EXTR_SKIP ); |
2716 | 2716 | |
2717 | 2717 | // Avatar DIR is found. |
… |
… |
function bp_the_members_invitation_action_links( $args = '' ) { |
3189 | 3189 | $inviter_id = isset( $args['inviter_id'] ) ? $args['inviter_id'] : bp_displayed_user_id(); |
3190 | 3190 | |
3191 | 3191 | // Parse. |
3192 | | $r = wp_parse_args( $args, array( |
| 3192 | $r = bp_parse_args( $args, array( |
3193 | 3193 | 'before' => '', |
3194 | 3194 | 'after' => '', |
3195 | 3195 | 'sep' => ' | ', |
-
diff --git src/bp-members/classes/class-bp-core-members-template.php src/bp-members/classes/class-bp-core-members-template.php
index ed82ef88f..101d9ec6b 100644
|
|
class BP_Core_Members_Template { |
173 | 173 | 'member_type__not_in' => '', |
174 | 174 | 'xprofile_query' => false, |
175 | 175 | ); |
176 | | $r = wp_parse_args( $args, $defaults ); |
| 176 | $r = bp_parse_args( $args, $defaults ); |
177 | 177 | |
178 | 178 | $this->pag_arg = sanitize_key( $r['page_arg'] ); |
179 | 179 | $this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $r['page_number'] ); |
-
diff --git src/bp-members/classes/class-bp-members-invitations-template.php src/bp-members/classes/class-bp-members-invitations-template.php
index 9b2554f60..3270eed7d 100644
|
|
class BP_Members_Invitations_Template { |
162 | 162 | public function __construct( $args = array() ) { |
163 | 163 | |
164 | 164 | // Parse arguments. |
165 | | $r = wp_parse_args( |
| 165 | $r = bp_parse_args( |
166 | 166 | $args, |
167 | 167 | array( |
168 | 168 | 'id' => false, |
-
diff --git src/bp-members/classes/class-bp-signup.php src/bp-members/classes/class-bp-signup.php
index 1f12411cd..0cb880f38 100644
|
|
class BP_Signup { |
730 | 730 | |
731 | 731 | // Figure out which meta keys should be updated. |
732 | 732 | $signup = new BP_Signup( $signup_id ); |
733 | | $blended_meta = wp_parse_args( $r['meta'], $signup->meta ); |
| 733 | $blended_meta = bp_parse_args( $r['meta'], $signup->meta ); |
734 | 734 | |
735 | 735 | $wpdb->update( |
736 | 736 | // Signups table. |
-
diff --git src/bp-members/screens/invitations.php src/bp-members/screens/invitations.php
index 8bb103179..157cf8ae3 100644
|
|
function members_screen_send_invites() { |
27 | 27 | 'send_invite' => 1, |
28 | 28 | ); |
29 | 29 | |
30 | | $invite_args = wp_parse_args( array_map( 'wp_unslash', $_REQUEST ), $default_args ); |
| 30 | $invite_args = bp_parse_args( array_map( 'wp_unslash', $_REQUEST ), $default_args ); |
31 | 31 | $invite_args = array_intersect_key( $invite_args, $default_args ); |
32 | 32 | |
33 | 33 | // Check the nonce and delete the invitation. |
-
diff --git src/bp-messages/bp-messages-star.php src/bp-messages/bp-messages-star.php
index 0ec5aa5ef..5a1353f95 100644
|
|
function bp_the_message_star_action_link( $args = array() ) { |
247 | 247 | * @return bool |
248 | 248 | */ |
249 | 249 | function bp_messages_star_set_action( $args = array() ) { |
250 | | $r = wp_parse_args( $args, array( |
| 250 | $r = bp_parse_args( $args, array( |
251 | 251 | 'action' => 'star', |
252 | 252 | 'thread_id' => 0, |
253 | 253 | 'message_id' => 0, |
-
diff --git src/bp-messages/classes/class-bp-messages-box-template.php src/bp-messages/classes/class-bp-messages-box-template.php
index daae957b1..fafef79da 100644
|
|
class BP_Messages_Box_Template { |
126 | 126 | $args = bp_core_parse_args_array( $old_args_keys, $function_args ); |
127 | 127 | } |
128 | 128 | |
129 | | $r = wp_parse_args( $args, array( |
| 129 | $r = bp_parse_args( $args, array( |
130 | 130 | 'page' => 1, |
131 | 131 | 'per_page' => 10, |
132 | 132 | 'page_arg' => 'mpage', |
-
diff --git src/bp-messages/classes/class-bp-messages-notice.php src/bp-messages/classes/class-bp-messages-notice.php
index 0ef29e31a..5888e2c57 100644
|
|
class BP_Messages_Notice { |
240 | 240 | public static function get_notices( $args = array() ) { |
241 | 241 | global $wpdb; |
242 | 242 | |
243 | | $r = wp_parse_args( $args, array( |
| 243 | $r = bp_parse_args( $args, array( |
244 | 244 | 'pag_num' => 20, // Number of notices per page. |
245 | 245 | 'pag_page' => 1 // Page number. |
246 | 246 | ) ); |
-
diff --git src/bp-messages/classes/class-bp-messages-notices-admin.php src/bp-messages/classes/class-bp-messages-notices-admin.php
index b6c2aafa0..2bc5dc113 100644
|
|
class BP_Messages_Notices_Admin { |
126 | 126 | |
127 | 127 | check_admin_referer( 'new-notice', 'ns-nonce' ); |
128 | 128 | |
129 | | $notice = wp_parse_args( $_POST['bp_notice'], array( |
| 129 | $notice = bp_parse_args( $_POST['bp_notice'], array( |
130 | 130 | 'subject' => '', |
131 | 131 | 'content' => '' |
132 | 132 | ) ); |
-
diff --git src/bp-messages/classes/class-bp-messages-sitewide-notices-widget.php src/bp-messages/classes/class-bp-messages-sitewide-notices-widget.php
index 93dc101b0..c8566c4fa 100644
|
|
class BP_Messages_Sitewide_Notices_Widget extends WP_Widget { |
108 | 108 | * @param array $instance See {@WP_Widget::form()}. |
109 | 109 | */ |
110 | 110 | public function form( $instance ) { |
111 | | $instance = wp_parse_args( (array) $instance, array( |
| 111 | $instance = bp_parse_args( (array) $instance, array( |
112 | 112 | 'title' => '', |
113 | 113 | ) ); |
114 | 114 | |
-
diff --git src/bp-messages/classes/class-bp-messages-thread.php src/bp-messages/classes/class-bp-messages-thread.php
index 8a2845d21..11c3399f8 100644
|
|
class BP_Messages_Thread { |
170 | 170 | bp_loggedin_user_id(); |
171 | 171 | |
172 | 172 | // Merge $args with our defaults. |
173 | | $r = wp_parse_args( |
| 173 | $r = bp_parse_args( |
174 | 174 | $args, |
175 | 175 | array( |
176 | 176 | 'user_id' => $user_id, |
… |
… |
class BP_Messages_Thread { |
283 | 283 | } |
284 | 284 | |
285 | 285 | $bp = buddypress(); |
286 | | $r = wp_parse_args( |
| 286 | $r = bp_parse_args( |
287 | 287 | $args, |
288 | 288 | array( |
289 | 289 | 'recipients_page' => null, |
… |
… |
class BP_Messages_Thread { |
364 | 364 | } |
365 | 365 | |
366 | 366 | $bp = buddypress(); |
367 | | $r = wp_parse_args( |
| 367 | $r = bp_parse_args( |
368 | 368 | $args, |
369 | 369 | array( |
370 | 370 | 'page' => null, |
-
diff --git src/bp-notifications/bp-notifications-template.php src/bp-notifications/bp-notifications-template.php
index 4c33d7825..d8771319d 100644
|
|
function bp_the_notification_action_links( $args = '' ) { |
885 | 885 | $user_id = isset( $args['user_id'] ) ? $args['user_id'] : bp_displayed_user_id(); |
886 | 886 | |
887 | 887 | // Parse. |
888 | | $r = wp_parse_args( $args, array( |
| 888 | $r = bp_parse_args( $args, array( |
889 | 889 | 'before' => '', |
890 | 890 | 'after' => '', |
891 | 891 | 'sep' => ' | ', |
-
diff --git src/bp-notifications/classes/class-bp-notifications-notification.php src/bp-notifications/classes/class-bp-notifications-notification.php
index 9e2bee2f9..85024df9c 100644
|
|
class BP_Notifications_Notification { |
616 | 616 | * @return array |
617 | 617 | */ |
618 | 618 | public static function parse_args( $args = '' ) { |
619 | | return wp_parse_args( $args, array( |
| 619 | return bp_parse_args( $args, array( |
620 | 620 | 'id' => false, |
621 | 621 | 'user_id' => false, |
622 | 622 | 'item_id' => false, |
… |
… |
class BP_Notifications_Notification { |
1030 | 1030 | * } |
1031 | 1031 | */ |
1032 | 1032 | public static function get_current_notifications_for_user( $args = array() ) { |
1033 | | $r = wp_parse_args( $args, array( |
| 1033 | $r = bp_parse_args( $args, array( |
1034 | 1034 | 'user_id' => bp_loggedin_user_id(), |
1035 | 1035 | 'is_new' => true, |
1036 | 1036 | 'page' => 1, |
-
diff --git src/bp-notifications/classes/class-bp-notifications-template.php src/bp-notifications/classes/class-bp-notifications-template.php
index c57f0e131..340ed406a 100644
|
|
class BP_Notifications_Template { |
152 | 152 | public function __construct( $args = array() ) { |
153 | 153 | |
154 | 154 | // Parse arguments. |
155 | | $r = wp_parse_args( $args, array( |
| 155 | $r = bp_parse_args( $args, array( |
156 | 156 | 'id' => false, |
157 | 157 | 'user_id' => 0, |
158 | 158 | 'item_id' => false, |
-
diff --git src/bp-templates/bp-legacy/buddypress-functions.php src/bp-templates/bp-legacy/buddypress-functions.php
index 44db3a2e7..b542f193e 100644
|
|
function bp_legacy_theme_ajax_querystring( $query_string, $object ) { |
700 | 700 | |
701 | 701 | // Set up the cookies passed on this AJAX request. Store a local var to avoid conflicts. |
702 | 702 | if ( ! empty( $_POST['cookie'] ) ) { |
703 | | $_BP_COOKIE = wp_parse_args( str_replace( '; ', '&', urldecode( $_POST['cookie'] ) ) ); |
| 703 | $_BP_COOKIE = bp_parse_args( str_replace( '; ', '&', urldecode( $_POST['cookie'] ) ) ); |
704 | 704 | } else { |
705 | 705 | $_BP_COOKIE = &$_COOKIE; |
706 | 706 | } |
-
diff --git src/bp-xprofile/bp-xprofile-functions.php src/bp-xprofile/bp-xprofile-functions.php
index f13a9239f..5770fabf7 100644
|
|
function bp_xprofile_create_field_type( $type ) { |
230 | 230 | */ |
231 | 231 | function xprofile_insert_field( $args = '' ) { |
232 | 232 | |
233 | | $r = wp_parse_args( $args, array( |
| 233 | $r = bp_parse_args( $args, array( |
234 | 234 | 'field_id' => null, |
235 | 235 | 'field_group_id' => null, |
236 | 236 | 'parent_id' => null, |
-
diff --git src/bp-xprofile/bp-xprofile-template.php src/bp-xprofile/bp-xprofile-template.php
index 78fff208c..f91f3d11f 100644
|
|
function bp_profile_field_data( $args = '' ) { |
954 | 954 | */ |
955 | 955 | function bp_get_profile_field_data( $args = '' ) { |
956 | 956 | |
957 | | $r = wp_parse_args( $args, array( |
| 957 | $r = bp_parse_args( $args, array( |
958 | 958 | 'field' => false, // Field name or ID. |
959 | 959 | 'user_id' => bp_displayed_user_id() |
960 | 960 | ) ); |
-
diff --git src/bp-xprofile/classes/class-bp-xprofile-data-template.php src/bp-xprofile/classes/class-bp-xprofile-data-template.php
index 118e5961e..66a0b14fb 100644
|
|
class BP_XProfile_Data_Template { |
148 | 148 | $args = bp_core_parse_args_array( $old_args_keys, $function_args ); |
149 | 149 | } |
150 | 150 | |
151 | | $r = wp_parse_args( $args, array( |
| 151 | $r = bp_parse_args( $args, array( |
152 | 152 | 'profile_group_id' => false, |
153 | 153 | 'user_id' => false, |
154 | 154 | 'member_type' => 'any', |
-
diff --git src/bp-xprofile/classes/class-bp-xprofile-field-type-checkbox-acceptance.php src/bp-xprofile/classes/class-bp-xprofile-field-type-checkbox-acceptance.php
index 3eb97d3ce..dbc8a73ef 100644
|
|
class BP_XProfile_Field_Type_Checkbox_Acceptance extends BP_XProfile_Field_Type |
243 | 243 | */ |
244 | 244 | public function edit_field_options_html( array $args = array() ) { |
245 | 245 | $field_id = (int) $this->field_obj->id; |
246 | | $params = wp_parse_args( $args, array( 'user_id' => bp_displayed_user_id() ) ); |
| 246 | $params = bp_parse_args( $args, array( 'user_id' => bp_displayed_user_id() ) ); |
247 | 247 | $checkbox_acceptance = (int) maybe_unserialize( \BP_XProfile_ProfileData::get_value_byid( $field_id, $params['user_id'] ) ); |
248 | 248 | |
249 | 249 | if ( ! empty( $_POST[ 'field_' . $field_id ] ) ) { |
-
diff --git src/bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php src/bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php
index 61bf0bdf6..c42daf77e 100644
|
|
class BP_XProfile_Field_Type_Textarea extends BP_XProfile_Field_Type { |
74 | 74 | do_action( bp_get_the_profile_field_errors_action() ); |
75 | 75 | |
76 | 76 | if ( ! $richtext_enabled ) { |
77 | | $r = wp_parse_args( $raw_properties, array( |
| 77 | $r = bp_parse_args( $raw_properties, array( |
78 | 78 | 'cols' => 40, |
79 | 79 | 'rows' => 5, |
80 | 80 | ) ); |
-
diff --git src/bp-xprofile/classes/class-bp-xprofile-field-type-wordpress-biography.php src/bp-xprofile/classes/class-bp-xprofile-field-type-wordpress-biography.php
index 47d078719..1d6a9ed28 100644
|
|
class BP_XProfile_Field_Type_WordPress_Biography extends BP_XProfile_Field_Type_ |
111 | 111 | /** This action is documented in bp-xprofile/bp-xprofile-classes */ |
112 | 112 | do_action( bp_get_the_profile_field_errors_action() ); |
113 | 113 | |
114 | | $r = wp_parse_args( $raw_properties, array( |
| 114 | $r = bp_parse_args( $raw_properties, array( |
115 | 115 | 'cols' => 40, |
116 | 116 | 'rows' => 5, |
117 | 117 | ) ); |
-
diff --git src/bp-xprofile/classes/class-bp-xprofile-field-type-wordpress-textbox.php src/bp-xprofile/classes/class-bp-xprofile-field-type-wordpress-textbox.php
index f31a48a11..e097eff4b 100644
|
|
class BP_XProfile_Field_Type_WordPress_Textbox extends BP_XProfile_Field_Type_Wo |
160 | 160 | $field_value = bp_get_user_meta( $user_id, $this->wp_user_key, true ); |
161 | 161 | } |
162 | 162 | |
163 | | $r = wp_parse_args( $raw_properties, array( |
| 163 | $r = bp_parse_args( $raw_properties, array( |
164 | 164 | 'type' => 'text', |
165 | 165 | 'value' => $this->sanitize_for_output( $field_value, $user_id ), |
166 | 166 | ) ); |
… |
… |
class BP_XProfile_Field_Type_WordPress_Textbox extends BP_XProfile_Field_Type_Wo |
195 | 195 | * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. |
196 | 196 | */ |
197 | 197 | public function admin_field_html( array $raw_properties = array() ) { |
198 | | $r = wp_parse_args( $raw_properties, array( |
| 198 | $r = bp_parse_args( $raw_properties, array( |
199 | 199 | 'type' => 'text' |
200 | 200 | ) ); ?> |
201 | 201 | |
-
diff --git src/bp-xprofile/classes/class-bp-xprofile-group.php src/bp-xprofile/classes/class-bp-xprofile-group.php
index 6b50d35b6..bf628e432 100644
|
|
class BP_XProfile_Group { |
271 | 271 | global $wpdb; |
272 | 272 | |
273 | 273 | // Parse arguments. |
274 | | $r = wp_parse_args( $args, array( |
| 274 | $r = bp_parse_args( $args, array( |
275 | 275 | 'profile_group_id' => false, |
276 | 276 | 'user_id' => bp_displayed_user_id(), |
277 | 277 | 'member_type' => false, |
-
diff --git tests/phpunit/assets/class-bptest-component.php tests/phpunit/assets/class-bptest-component.php
index 1b6c006a6..3cfadd4b7 100644
|
|
class BPTest_Component extends BP_Component { |
11 | 11 | |
12 | 12 | // Start the `test` component setup process. |
13 | 13 | public function __construct( $args = array() ) { |
14 | | $r = wp_parse_args( |
| 14 | $r = bp_parse_args( |
15 | 15 | $args, |
16 | 16 | array( |
17 | 17 | 'id' => 'example', |
-
diff --git tests/phpunit/includes/factory.php tests/phpunit/includes/factory.php
index 343984a6c..568c18d62 100644
|
|
class BP_UnitTest_Factory_For_User extends WP_UnitTest_Factory_For_User { |
27 | 27 | * Also set a display name |
28 | 28 | */ |
29 | 29 | public function create_object( $args ) { |
30 | | $r = wp_parse_args( $args, array( |
| 30 | $r = bp_parse_args( $args, array( |
31 | 31 | 'role' => 'subscriber', |
32 | 32 | 'last_activity' => date( 'Y-m-d H:i:s', strtotime( bp_core_current_time() ) - 60*60*24*365 ), |
33 | 33 | ) ); |
-
diff --git tests/phpunit/includes/testcase.php tests/phpunit/includes/testcase.php
index 1428a6e17..161d17f83 100644
|
|
class BP_UnitTestCase extends WP_UnitTestCase { |
220 | 220 | } |
221 | 221 | |
222 | 222 | public static function add_user_to_group( $user_id, $group_id, $args = array() ) { |
223 | | $r = wp_parse_args( $args, array( |
| 223 | $r = bp_parse_args( $args, array( |
224 | 224 | 'date_modified' => bp_core_current_time(), |
225 | 225 | 'is_confirmed' => 1, |
226 | 226 | 'is_admin' => 0, |