Changeset 13878
- Timestamp:
- 06/01/2024 04:26:18 PM (18 months ago)
- Location:
- trunk
- Files:
-
- 61 edited
-
src/bp-activity/bp-activity-filters.php (modified) (2 diffs)
-
src/bp-activity/bp-activity-functions.php (modified) (5 diffs)
-
src/bp-activity/classes/class-bp-activity-list-table.php (modified) (1 diff)
-
src/bp-activity/classes/class-bp-activity-template.php (modified) (1 diff)
-
src/bp-core/admin/bp-core-admin-functions.php (modified) (2 diffs)
-
src/bp-core/admin/bp-core-admin-settings.php (modified) (2 diffs)
-
src/bp-core/admin/bp-core-admin-tools.php (modified) (4 diffs)
-
src/bp-core/bp-core-avatars.php (modified) (5 diffs)
-
src/bp-core/bp-core-buddybar.php (modified) (1 diff)
-
src/bp-core/bp-core-caps.php (modified) (2 diffs)
-
src/bp-core/bp-core-cssjs.php (modified) (1 diff)
-
src/bp-core/bp-core-customizer-email.php (modified) (1 diff)
-
src/bp-core/bp-core-filters.php (modified) (2 diffs)
-
src/bp-core/bp-core-functions.php (modified) (2 diffs)
-
src/bp-core/bp-core-moderation.php (modified) (1 diff)
-
src/bp-core/bp-core-template-loader.php (modified) (1 diff)
-
src/bp-core/bp-core-template.php (modified) (4 diffs)
-
src/bp-core/classes/class-bp-admin.php (modified) (4 diffs)
-
src/bp-core/classes/class-bp-component.php (modified) (7 diffs)
-
src/bp-core/classes/class-bp-core-html-element.php (modified) (1 diff)
-
src/bp-core/classes/class-bp-core-nav.php (modified) (1 diff)
-
src/bp-core/classes/class-bp-core-oembed-extension.php (modified) (2 diffs)
-
src/bp-core/classes/class-bp-core.php (modified) (2 diffs)
-
src/bp-core/deprecated/1.5.php (modified) (1 diff)
-
src/bp-core/deprecated/1.6.php (modified) (1 diff)
-
src/bp-friends/classes/class-bp-friends-friendship.php (modified) (1 diff)
-
src/bp-groups/actions/create.php (modified) (1 diff)
-
src/bp-groups/bp-groups-admin.php (modified) (1 diff)
-
src/bp-groups/classes/class-bp-group-extension.php (modified) (2 diffs)
-
src/bp-groups/classes/class-bp-groups-list-table.php (modified) (1 diff)
-
src/bp-groups/screens/single/send-invites.php (modified) (1 diff)
-
src/bp-members/bp-members-filters.php (modified) (1 diff)
-
src/bp-members/bp-members-functions.php (modified) (1 diff)
-
src/bp-members/classes/class-bp-members-admin.php (modified) (2 diffs)
-
src/bp-members/screens/register.php (modified) (1 diff)
-
src/bp-messages/bp-messages-cssjs.php (modified) (1 diff)
-
src/bp-messages/bp-messages-template.php (modified) (1 diff)
-
src/bp-messages/classes/class-bp-messages-thread.php (modified) (2 diffs)
-
src/bp-templates/bp-legacy/buddypress-functions.php (modified) (2 diffs)
-
src/bp-templates/bp-nouveau/buddypress-functions.php (modified) (1 diff)
-
src/bp-templates/bp-nouveau/includes/activity/ajax.php (modified) (1 diff)
-
src/bp-templates/bp-nouveau/includes/activity/loader.php (modified) (1 diff)
-
src/bp-templates/bp-nouveau/includes/blogs/ajax.php (modified) (1 diff)
-
src/bp-templates/bp-nouveau/includes/blogs/functions.php (modified) (2 diffs)
-
src/bp-templates/bp-nouveau/includes/blogs/loader.php (modified) (2 diffs)
-
src/bp-templates/bp-nouveau/includes/friends/ajax.php (modified) (1 diff)
-
src/bp-templates/bp-nouveau/includes/friends/loader.php (modified) (1 diff)
-
src/bp-templates/bp-nouveau/includes/groups/ajax.php (modified) (1 diff)
-
src/bp-templates/bp-nouveau/includes/groups/loader.php (modified) (1 diff)
-
src/bp-templates/bp-nouveau/includes/messages/ajax.php (modified) (2 diffs)
-
src/bp-templates/bp-nouveau/includes/messages/loader.php (modified) (1 diff)
-
src/bp-xprofile/bp-xprofile-admin.php (modified) (1 diff)
-
src/bp-xprofile/bp-xprofile-filters.php (modified) (4 diffs)
-
src/bp-xprofile/bp-xprofile-functions.php (modified) (7 diffs)
-
src/bp-xprofile/bp-xprofile-template.php (modified) (1 diff)
-
src/bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php (modified) (1 diff)
-
src/bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php (modified) (1 diff)
-
src/bp-xprofile/classes/class-bp-xprofile-field.php (modified) (1 diff)
-
src/bp-xprofile/classes/class-bp-xprofile-group.php (modified) (6 diffs)
-
tests/phpunit/includes/loader.php (modified) (1 diff)
-
tests/phpunit/testcases/core/class-bp-user-query.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-filters.php
r13636 r13878 306 306 if ( ! empty( $usernames ) ) { 307 307 // Replace @mention text with userlinks. 308 foreach ( (array) $usernames as $user_id => $username ) {308 foreach ( (array) $usernames as $user_id => $username ) { 309 309 $activity->content = preg_replace( '/(@' . $username . '\b)/', "<a class='bp-suggestions-mention' href='" . bp_members_get_user_url( $user_id ) . "' rel='nofollow'>@$username</a>", $activity->content ); 310 310 } … … 344 344 345 345 // Send @mentions and setup BP notifications. 346 foreach ( (array) $usernames as $user_id => $username ) {346 foreach ( (array) $usernames as $user_id => $username ) { 347 347 348 348 /** -
trunk/src/bp-activity/bp-activity-functions.php
r13716 r13878 104 104 105 105 // We've found some mentions! Check to see if users exist. 106 foreach ( (array) array_values( $usernames ) as $username ) {106 foreach ( (array) array_values( $usernames ) as $username ) { 107 107 $user_id = bp_activity_get_userid_from_mentionname( $username ); 108 108 … … 181 181 182 182 // Increment mention count foreach mentioned user. 183 foreach ( (array) array_keys( $usernames ) as $user_id ) {183 foreach ( (array) array_keys( $usernames ) as $user_id ) { 184 184 bp_activity_update_mention_count_for_user( $user_id, $activity_id, $action ); 185 185 } … … 3256 3256 // Recursively delete all children of this comment. 3257 3257 if ( ! empty( $children ) ) { 3258 foreach ( (array) $children as $child ) {3258 foreach ( (array) $children as $child ) { 3259 3259 bp_activity_delete_children( $activity_id, $child->id ); 3260 3260 } … … 3853 3853 3854 3854 // Don't leave multiple notifications for the same activity item. 3855 foreach ( $notifications as $notification ) {3855 foreach ( $notifications as $notification ) { 3856 3856 if ( $activity_id == $notification->item_id ) { 3857 3857 return; … … 4122 4122 buddypress()->activity->read_more_id = $activity->id; 4123 4123 4124 add_filter( 'embed_post_id', function () { return buddypress()->activity->read_more_id; } );4124 add_filter( 'embed_post_id', function () { return buddypress()->activity->read_more_id; } ); 4125 4125 add_filter( 'bp_embed_get_cache', 'bp_embed_activity_cache', 10, 3 ); 4126 4126 add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 ); -
trunk/src/bp-activity/classes/class-bp-activity-list-table.php
r13816 r13878 181 181 182 182 // Sort the array by the activity object's date_recorded value. 183 usort( $activities['activities'], function ( $a, $b ) { return $a->date_recorded > $b->date_recorded; } );183 usort( $activities['activities'], function ( $a, $b ) { return $a->date_recorded > $b->date_recorded; } ); 184 184 } 185 185 -
trunk/src/bp-activity/classes/class-bp-activity-template.php
r13816 r13878 313 313 314 314 if ( !empty( $activity_parents['activities'] ) ) { 315 foreach ( $activity_parents['activities'] as $parent ) {315 foreach ( $activity_parents['activities'] as $parent ) { 316 316 $this->activity_parents[ $parent->id ] = $parent; 317 317 } -
trunk/src/bp-core/admin/bp-core-admin-functions.php
r13871 r13878 1407 1407 ?> 1408 1408 <script type="text/javascript"> 1409 jQuery( '#menu-to-edit').on( 'click', 'a.item-edit', function () {1409 jQuery( '#menu-to-edit').on( 'click', 'a.item-edit', function () { 1410 1410 var settings = jQuery(this).closest( '.menu-item-bar' ).next( '.menu-item-settings' ); 1411 1411 var css_class = settings.find( '.edit-menu-item-classes' ); … … 1541 1541 ?> 1542 1542 <script type="text/javascript"> 1543 jQuery( document ).ready( function ($) {1544 $( '.row-actions .ham' ).each( function () {1543 jQuery( document ).ready( function ($) { 1544 $( '.row-actions .ham' ).each( function () { 1545 1545 $( this ).closest( 'tr' ).addClass( 'site-spammed' ); 1546 1546 }); -
trunk/src/bp-core/admin/bp-core-admin-settings.php
r13870 r13878 432 432 // in the $_POST array when unchecked, we loop through the registered settings. 433 433 if ( isset( $wp_settings_fields['buddypress'] ) ) { 434 foreach ( (array) $wp_settings_fields['buddypress'] as $section => $settings ) {435 foreach ( $settings as $setting_name => $setting ) {434 foreach ( (array) $wp_settings_fields['buddypress'] as $section => $settings ) { 435 foreach ( $settings as $setting_name => $setting ) { 436 436 $value = isset( $_POST[$setting_name] ) ? $_POST[$setting_name] : ''; 437 437 … … 455 455 ); 456 456 457 foreach ( $legacy_options as $legacy_option ) {457 foreach ( $legacy_options as $legacy_option ) { 458 458 // Note: Each of these options is represented by its opposite in the UI 459 459 // Ie, the Profile Syncing option reads "Enable Sync", so when it's checked, -
trunk/src/bp-core/admin/bp-core-admin-tools.php
r13818 r13878 558 558 $message = '<div id="message" class="' . esc_attr( $class ) . ' notice is-dismissible">' . $message . '</div>'; 559 559 $message = str_replace( "'", "\'", $message ); 560 $lambda = function () use ( $message ) {560 $lambda = function () use ( $message ) { 561 561 echo wp_kses( 562 562 $message, … … 782 782 } 783 783 784 foreach ( $settings as $bp_setting ) {784 foreach ( $settings as $bp_setting ) { 785 785 $reverse = ( 786 786 strpos( $bp_setting['id'], 'hide' ) !== false || … … 1130 1130 wp_add_inline_script( 1131 1131 'site-health', 1132 '( function () {1132 '( function () { 1133 1133 let bpHelpSidebarLinks; 1134 1134 1135 document.onreadystatechange = function () {1135 document.onreadystatechange = function () { 1136 1136 if ( document.readyState === "complete" ) { 1137 1137 bpHelpSidebarLinks = document.querySelector( \'.bp-help-sidebar-links\' ).closest( \'p\') … … 1142 1142 document.querySelectorAll( \'.contextual-help-tabs ul li a\' ).forEach( 1143 1143 function( a ) { 1144 a.addEventListener( \'click\', function ( e ) {1144 a.addEventListener( \'click\', function ( e ) { 1145 1145 if ( \'tab-link-bp-debug-settings\' === e.target.parentElement.getAttribute( \'id\' ) ) { 1146 1146 bpHelpSidebarLinks.style.display = \'block\'; -
trunk/src/bp-core/bp-core-avatars.php
r13541 r13878 537 537 538 538 // Check for current avatar. 539 foreach ( $avatar_files as $key => $value ) {539 foreach ( $avatar_files as $key => $value ) { 540 540 if ( strpos ( $value, $avatar_size )!== false ) { 541 541 $avatar_url = $avatar_folder_url . '/' . $avatar_files[$key]; … … 545 545 // Legacy avatar check. 546 546 if ( !isset( $avatar_url ) ) { 547 foreach ( $avatar_files as $key => $value ) {547 foreach ( $avatar_files as $key => $value ) { 548 548 if ( strpos ( $value, $legacy_user_avatar_name )!== false ) { 549 549 $avatar_url = $avatar_folder_url . '/' . $avatar_files[$key]; … … 553 553 // Legacy group avatar check. 554 554 if ( !isset( $avatar_url ) ) { 555 foreach ( $avatar_files as $key => $value ) {555 foreach ( $avatar_files as $key => $value ) { 556 556 if ( strpos ( $value, $legacy_group_avatar_name )!== false ) { 557 557 $avatar_url = $avatar_folder_url . '/' . $avatar_files[$key]; … … 2313 2313 // Add a revision of the current avatar if it's not a mystery man! 2314 2314 if ( $current_avatars ) { 2315 foreach ( $current_avatars as $current_avatar ) {2315 foreach ( $current_avatars as $current_avatar ) { 2316 2316 if ( ! isset( $current_avatar->name, $current_avatar->id, $current_avatar->path ) ) { 2317 2317 continue; … … 2394 2394 } 2395 2395 } else { 2396 foreach ( $avatar_types as $type_key => $avatar_path ) {2396 foreach ( $avatar_types as $type_key => $avatar_path ) { 2397 2397 $filename = wp_basename( $avatar_path ); 2398 2398 $avatar_id = pathinfo( $filename, PATHINFO_FILENAME ); -
trunk/src/bp-core/bp-core-buddybar.php
r13519 r13878 968 968 } 969 969 970 foreach ( $subnav_items as $subnav_item ) {970 foreach ( $subnav_items as $subnav_item ) { 971 971 $bp->{$component}->nav->delete_nav( $subnav_item->slug, $parent_slug ); 972 972 } -
trunk/src/bp-core/bp-core-caps.php
r13818 r13878 71 71 72 72 // Loop through available roles and add them. 73 foreach ( $wp_roles->role_objects as $role ) {73 foreach ( $wp_roles->role_objects as $role ) { 74 74 foreach ( bp_get_caps_for_role( $role->name ) as $cap ) { 75 75 $role->add_cap( $cap ); … … 105 105 106 106 // Loop through available roles and remove them. 107 foreach ( $wp_roles->role_objects as $role ) {107 foreach ( $wp_roles->role_objects as $role ) { 108 108 foreach ( bp_get_caps_for_role( $role->name ) as $cap ) { 109 109 $role->remove_cap( $cap ); -
trunk/src/bp-core/bp-core-cssjs.php
r13818 r13878 282 282 283 283 <script type="text/javascript"> 284 jQuery( window ).on( 'load', function () {284 jQuery( window ).on( 'load', function () { 285 285 jQuery( '#avatar-to-crop' ).Jcrop( { 286 286 onChange: showPreview, -
trunk/src/bp-core/bp-core-customizer-email.php
r11904 r13878 29 29 30 30 $sections = bp_email_get_customizer_sections(); 31 foreach ( $sections as $section_id => $args ) {31 foreach ( $sections as $section_id => $args ) { 32 32 $wp_customize->add_section( $section_id, $args ); 33 33 } 34 34 35 35 $settings = bp_email_get_customizer_settings(); 36 foreach ( $settings as $setting_id => $args ) {36 foreach ( $settings as $setting_id => $args ) { 37 37 $wp_customize->add_setting( $setting_id, $args ); 38 38 } -
trunk/src/bp-core/bp-core-filters.php
r13818 r13878 291 291 global $wpdb; 292 292 293 foreach ( (array) $comments as $comment ) {293 foreach ( (array) $comments as $comment ) { 294 294 if ( $comment->user_id ) { 295 295 $user_ids[] = $comment->user_id; … … 307 307 } 308 308 309 foreach ( (array) $userdata as $user ) {309 foreach ( (array) $userdata as $user ) { 310 310 $users[$user->user_id] = bp_members_get_user_url( $user->user_id ); 311 311 } 312 312 313 foreach ( (array) $comments as $i => $comment ) {313 foreach ( (array) $comments as $i => $comment ) { 314 314 if ( ! empty( $comment->user_id ) ) { 315 315 if ( ! empty( $users[$comment->user_id] ) ) { -
trunk/src/bp-core/bp-core-functions.php
r13818 r13878 208 208 */ 209 209 function bp_sort_by_key( $items, $key, $type = 'alpha', $preserve_keys = false ) { 210 $callback = function ( $a, $b ) use ( $key, $type ) {210 $callback = function ( $a, $b ) use ( $key, $type ) { 211 211 $values = array( 0 => false, 1 => false ); 212 212 foreach ( func_get_args() as $indexi => $index ) { … … 2801 2801 $user_is_displayed = bp_is_user(); 2802 2802 2803 foreach ( $primary_items as $primary_item ) {2803 foreach ( $primary_items as $primary_item ) { 2804 2804 $current_user_link = $primary_item['link']; 2805 2805 -
trunk/src/bp-core/bp-core-moderation.php
r13649 r13878 306 306 307 307 // Loop through post data. 308 foreach ( $_post as $post_data ) {308 foreach ( $_post as $post_data ) { 309 309 310 310 // Check each user data for current word. -
trunk/src/bp-core/bp-core-template-loader.php
r13867 r13878 363 363 // Loop through 'bp_template_stack' filters, and call callback functions. 364 364 do { 365 foreach ( (array) current( $filter ) as $the_ ) {365 foreach ( (array) current( $filter ) as $the_ ) { 366 366 if ( ! is_null( $the_['function'] ) ) { 367 367 $args[1] = $stack; -
trunk/src/bp-core/bp-core-template.php
r13844 r13878 473 473 */ 474 474 $options = apply_filters( 'bp_search_form_type_select_options', $options ); 475 foreach ( (array) $options as $option_value => $option_title ) {475 foreach ( (array) $options as $option_value => $option_title ) { 476 476 $selection_box .= sprintf( '<option value="%s">%s</option>', esc_attr( $option_value ), esc_html( $option_title ) ); 477 477 } … … 679 679 $attributes = (array) apply_filters( 'bp_get_form_field_attributes', $attributes, $name ); 680 680 681 foreach ( $attributes as $attr => $value ) {681 foreach ( $attributes as $attr => $value ) { 682 682 // Numeric keyed array. 683 683 if (is_numeric( $attr ) ) { … … 3220 3220 // Add current user member types. 3221 3221 if ( $member_types = bp_get_member_type( bp_displayed_user_id(), false ) ) { 3222 foreach ( $member_types as $member_type ) {3222 foreach ( $member_types as $member_type ) { 3223 3223 $bp_classes[] = sprintf( 'member-type-%s', esc_attr( $member_type ) ); 3224 3224 } … … 3509 3509 $submenus = array(); 3510 3510 3511 foreach ( $nav_menu->children as $sub_menu ) {3511 foreach ( $nav_menu->children as $sub_menu ) { 3512 3512 $submenu = new stdClass; 3513 3513 $submenu->class = array( 'menu-child' ); -
trunk/src/bp-core/classes/class-bp-admin.php
r13870 r13878 408 408 } 409 409 410 foreach ( $hooks as $hook ) {410 foreach ( $hooks as $hook ) { 411 411 add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' ); 412 412 … … 425 425 do_action_ref_array( 'bp_admin_submenu_pages', array( &$this->submenu_pages ) ); 426 426 427 foreach ( $this->submenu_pages as $subpage_type => $subpage_hooks ) {427 foreach ( $this->submenu_pages as $subpage_type => $subpage_hooks ) { 428 428 foreach ( $subpage_hooks as $subpage_hook ) { 429 429 add_action( "admin_print_styles-{$subpage_hook}", array( $this, 'add_inline_styles' ), 20 ); … … 468 468 ); 469 469 470 foreach ( $hooks as $hook ) {470 foreach ( $hooks as $hook ) { 471 471 add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' ); 472 472 } … … 1636 1636 'plugin-install', 1637 1637 ' 1638 ( function () {1639 document.onreadystatechange = function () {1638 ( function () { 1639 document.onreadystatechange = function () { 1640 1640 if ( document.readyState === "complete" ) { 1641 1641 document.querySelector( \'.plugin-card-bp-classic .open-plugin-details-modal\' ).click(); -
trunk/src/bp-core/classes/class-bp-component.php
r13741 r13878 652 652 // Sub nav items are not required. 653 653 if ( ! empty( $sub_nav ) ) { 654 foreach ( (array) $sub_nav as $nav ) {654 foreach ( (array) $sub_nav as $nav ) { 655 655 if ( ! isset( $nav['slug'], $nav['parent_slug'] ) ) { 656 656 continue; … … 732 732 // Sub nav items are not required. 733 733 if ( $this->sub_nav ) { 734 foreach ( (array) $this->sub_nav as $nav ) {734 foreach ( (array) $this->sub_nav as $nav ) { 735 735 if ( isset( $nav['user_has_access_callback'] ) && is_callable( $nav['user_has_access_callback'] ) ) { 736 736 $nav['user_has_access'] = call_user_func( $nav['user_has_access_callback'] ); … … 773 773 $this->sub_nav = $sub_nav; 774 774 775 foreach ( (array) $sub_nav as $nav ) {775 foreach ( (array) $sub_nav as $nav ) { 776 776 bp_core_new_subnav_item( $nav, 'members' ); 777 777 } … … 828 828 $pos = 0; 829 829 $not_set_pos = 1; 830 foreach ( $wp_admin_nav as $key => $nav ) {830 foreach ( $wp_admin_nav as $key => $nav ) { 831 831 if ( ! isset( $nav['position'] ) ) { 832 832 $wp_admin_nav[$key]['position'] = $pos + $not_set_pos; … … 852 852 853 853 // Add each admin menu. 854 foreach ( $this->admin_menu as $admin_menu ) {854 foreach ( $this->admin_menu as $admin_menu ) { 855 855 $wp_admin_bar->add_node( $admin_menu ); 856 856 } … … 972 972 */ 973 973 if ( !empty( $tables ) && is_array( $tables ) ) { 974 foreach ( $tables as $meta_prefix => $table_name ) {974 foreach ( $tables as $meta_prefix => $table_name ) { 975 975 $wpdb->{$meta_prefix . 'meta'} = $table_name; 976 976 } … … 1403 1403 $controllers = (array) apply_filters( 'bp_' . $this->id . '_rest_api_controllers', $controllers ); 1404 1404 1405 foreach ( $controllers as $controller ) {1405 foreach ( $controllers as $controller ) { 1406 1406 if ( ! in_array( $controller, $_controllers, true ) ) { 1407 1407 continue; -
trunk/src/bp-core/classes/class-bp-core-html-element.php
r11112 r13878 70 70 // Render attributes. 71 71 $attributes = ''; 72 foreach ( (array) $r['attr'] as $attr => $val ) {72 foreach ( (array) $r['attr'] as $attr => $val ) { 73 73 // If attribute is empty, skip. 74 74 if ( empty( $val ) ) { -
trunk/src/bp-core/classes/class-bp-core-nav.php
r13468 r13878 476 476 477 477 if ( $primary_nav_items ) { 478 foreach ( $primary_nav_items as $key_nav => $primary_nav ) {478 foreach ( $primary_nav_items as $key_nav => $primary_nav ) { 479 479 // Try to get the children. 480 480 $children = $this->get_secondary( array( 'parent_slug' => $primary_nav->slug, 'user_has_access' => true ) ); -
trunk/src/bp-core/classes/class-bp-core-oembed-extension.php
r13818 r13878 440 440 buddypress()->{$this->slug_endpoint}->embedargs_in_progress = array(); 441 441 442 foreach ( $custom_args as $arg ) {442 foreach ( $custom_args as $arg ) { 443 443 if ( isset( $request[ $arg ] ) ) { 444 444 buddypress()->{$this->slug_endpoint}->embedargs_in_progress[ $arg ] = $request[ $arg ]; … … 540 540 // Add custom route args to iframe. 541 541 if ( isset( buddypress()->{$this->slug_endpoint}->embedargs_in_progress ) && buddypress()->{$this->slug_endpoint}->embedargs_in_progress ) { 542 foreach ( buddypress()->{$this->slug_endpoint}->embedargs_in_progress as $key => $value ) {542 foreach ( buddypress()->{$this->slug_endpoint}->embedargs_in_progress as $key => $value ) { 543 543 $url = add_query_arg( $key, $value, $url ); 544 544 } -
trunk/src/bp-core/classes/class-bp-core.php
r13532 r13878 149 149 150 150 // Loop through optional components. 151 foreach ( $bp->optional_components as $component ) {151 foreach ( $bp->optional_components as $component ) { 152 152 if ( bp_is_active( $component ) && file_exists( $bp->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' ) ) { 153 153 include( $bp->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' ); … … 156 156 157 157 // Loop through required components. 158 foreach ( $bp->required_components as $component ) {158 foreach ( $bp->required_components as $component ) { 159 159 if ( file_exists( $bp->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' ) ) { 160 160 include( $bp->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' ); -
trunk/src/bp-core/deprecated/1.5.php
r13824 r13878 346 346 $group = new BP_Groups_Group( $group_id ); 347 347 348 foreach ( (array) $usernames as $username ) {348 foreach ( (array) $usernames as $username ) { 349 349 if ( !$receiver_user_id = bp_core_get_userid( $username ) ) 350 350 continue; -
trunk/src/bp-core/deprecated/1.6.php
r13824 r13878 265 265 266 266 // For each of the problematic hooks, exit at the very end of execution. 267 foreach ( $actions as $action ) {268 add_action( 'wp_ajax_' . $action, function () {267 foreach ( $actions as $action ) { 268 add_action( 'wp_ajax_' . $action, function () { 269 269 exit; 270 270 }, 9999 ); 271 271 272 add_action( 'wp_ajax_nopriv_' . $action, function () {272 add_action( 'wp_ajax_nopriv_' . $action, function () { 273 273 exit; 274 274 }, 9999 ); -
trunk/src/bp-friends/classes/class-bp-friends-friendship.php
r13427 r13878 736 736 737 737 // Sort and structure as expected in legacy function. 738 usort( $last_activities, function ( $a, $b ) {738 usort( $last_activities, function ( $a, $b ) { 739 739 if ( $a['date_recorded'] === $b['date_recorded'] ) { 740 740 return 0; -
trunk/src/bp-groups/actions/create.php
r13762 r13878 345 345 unset( $bp->groups->group_creation_steps ); 346 346 347 foreach ( (array) $temp as $position => $step ) {347 foreach ( (array) $temp as $position => $step ) { 348 348 $bp->groups->group_creation_steps[ $step['slug'] ] = array( 349 349 'rewrite_id' => $step['rewrite_id'], -
trunk/src/bp-groups/bp-groups-admin.php
r13871 r13878 361 361 } 362 362 363 foreach ( array_values( $user_names ) as $user_name ) {363 foreach ( array_values( $user_names ) as $user_name ) { 364 364 $un = trim( $user_name ); 365 365 -
trunk/src/bp-groups/classes/class-bp-group-extension.php
r13808 r13878 1292 1292 $this->edit_screen_template = '/groups/single/home'; 1293 1293 } else { 1294 add_action( 'bp_template_content_header', function () {1294 add_action( 'bp_template_content_header', function () { 1295 1295 echo '<ul class="content-header-nav">'; 1296 1296 bp_group_admin_tabs(); … … 1521 1521 1522 1522 $extension_slug = $this->slug; 1523 $callback = function () use ( $extension_slug, $group_id ) {1523 $callback = function () use ( $extension_slug, $group_id ) { 1524 1524 do_action( 'bp_groups_admin_meta_box_content_' . $extension_slug, $group_id ); 1525 1525 }; -
trunk/src/bp-groups/classes/class-bp-groups-list-table.php
r13808 r13878 884 884 <option value=""><?php esc_html_e( 'Change group type to…', 'buddypress' ) ?></option> 885 885 886 <?php foreach ( $types as $type ) : ?>886 <?php foreach ( $types as $type ) : ?> 887 887 888 888 <option value="<?php echo esc_attr( $type->name ); ?>"><?php echo esc_html( $type->labels['singular_name'] ); ?></option> -
trunk/src/bp-groups/screens/single/send-invites.php
r13762 r13878 30 30 31 31 if ( ! empty( $_POST['friends'] ) ) { 32 foreach ( (array) $_POST['friends'] as $friend ) {32 foreach ( (array) $_POST['friends'] as $friend ) { 33 33 groups_invite_user( array( 'user_id' => $friend, 'group_id' => $bp->groups->current_group->id ) ); 34 34 } -
trunk/src/bp-members/bp-members-filters.php
r13503 r13878 46 46 47 47 // Add the filters to each field. 48 foreach ( $fields as $filter ) {48 foreach ( $fields as $filter ) { 49 49 add_filter( $filter, 'esc_html', 1 ); 50 50 add_filter( $filter, 'wp_filter_kses', 2 ); -
trunk/src/bp-members/bp-members-functions.php
r13871 r13878 2102 2102 $profile_field_ids = explode( ',', $user['meta']['profile_field_ids'] ); 2103 2103 2104 foreach ( (array) $profile_field_ids as $field_id ) {2104 foreach ( (array) $profile_field_ids as $field_id ) { 2105 2105 $current_field = isset( $user['meta']["field_{$field_id}"] ) ? $user['meta']["field_{$field_id}"] : false; 2106 2106 -
trunk/src/bp-members/classes/class-bp-members-admin.php
r13871 r13878 2480 2480 ) ); 2481 2481 2482 foreach ( $field_groups as $fg ) {2483 foreach ( $fg->fields as $f ) {2482 foreach ( $field_groups as $fg ) { 2483 foreach ( $fg->fields as $f ) { 2484 2484 $fdata[ $f->id ] = $f->name; 2485 2485 } … … 2638 2638 <option value=""><?php esc_html_e( 'Change member type to…', 'buddypress' ) ?></option> 2639 2639 2640 <?php foreach ( $types as $type ) : ?>2640 <?php foreach ( $types as $type ) : ?> 2641 2641 2642 2642 <option value="<?php echo esc_attr( $type->name ); ?>"><?php echo esc_html( $type->labels['singular_name'] ); ?></option> -
trunk/src/bp-members/screens/register.php
r13799 r13878 197 197 * @param string $fieldname The name of the signup field. 198 198 */ 199 add_action( 'bp_' . $fieldname . '_errors', function () use ( $error_message, $fieldname ) {199 add_action( 'bp_' . $fieldname . '_errors', function () use ( $error_message, $fieldname ) { 200 200 echo wp_kses( 201 201 /** -
trunk/src/bp-messages/bp-messages-cssjs.php
r13464 r13878 65 65 var acfb = jQuery("ul.first").autoCompletefb({urlLookup: ajaxurl}); 66 66 67 jQuery('#send_message_form').submit( function () {67 jQuery('#send_message_form').submit( function () { 68 68 var users = document.getElementById('send-to-usernames').className; 69 69 document.getElementById('send-to-usernames').value = String(users); -
trunk/src/bp-messages/bp-messages-template.php
r13844 r13878 1983 1983 $recipient_links = array(); 1984 1984 1985 foreach ( (array) $thread_template->thread->recipients as $recipient ) {1985 foreach ( (array) $thread_template->thread->recipients as $recipient ) { 1986 1986 if ( (int) $recipient->user_id !== bp_loggedin_user_id() ) { 1987 1987 $recipient_link = bp_core_get_userlink( $recipient->user_id ); -
trunk/src/bp-messages/classes/class-bp-messages-thread.php
r13810 r13878 806 806 807 807 // Sort threads by date_sent. 808 foreach ( (array) $thread_ids as $thread ) {808 foreach ( (array) $thread_ids as $thread ) { 809 809 $sorted_threads[ $thread->thread_id ] = strtotime( $thread->date_sent ); 810 810 } … … 1236 1236 $bp = buddypress(); 1237 1237 1238 foreach ( (array) $threads as $thread ) {1238 foreach ( (array) $threads as $thread ) { 1239 1239 $message_ids = maybe_unserialize( $thread->message_ids ); 1240 1240 -
trunk/src/bp-templates/bp-legacy/buddypress-functions.php
r13876 r13878 186 186 * executes for users that aren't logged in. This is for backpat with BP <1.6. 187 187 */ 188 foreach ( $actions as $name => $function ) {188 foreach ( $actions as $name => $function ) { 189 189 bp_ajax_register_action( $name ); 190 190 add_action( 'wp_ajax_' . $name, $function ); … … 1768 1768 1769 1769 // Add new-message css class. 1770 add_filter( 'bp_get_the_thread_message_css_class', function ( $retval ) {1770 add_filter( 'bp_get_the_thread_message_css_class', function ( $retval ) { 1771 1771 $retval[] = 'new-message'; 1772 1772 return $retval; -
trunk/src/bp-templates/bp-nouveau/buddypress-functions.php
r13718 r13878 103 103 // Load AJAX code only on AJAX requests. 104 104 } else { 105 add_action( 'admin_init', function () {105 add_action( 'admin_init', function () { 106 106 if ( defined( 'DOING_AJAX' ) && true === DOING_AJAX ) { 107 107 require bp_nouveau()->includes_dir . 'ajax.php'; -
trunk/src/bp-templates/bp-nouveau/includes/activity/ajax.php
r13636 r13878 10 10 defined( 'ABSPATH' ) || exit; 11 11 12 add_action( 'admin_init', function () {12 add_action( 'admin_init', function () { 13 13 $ajax_actions = array( 14 14 array( -
trunk/src/bp-templates/bp-nouveau/includes/activity/loader.php
r13481 r13878 69 69 // Load AJAX code only on AJAX requests. 70 70 } else { 71 add_action( 'admin_init', function () {71 add_action( 'admin_init', function () { 72 72 // AJAX condtion. 73 73 if ( defined( 'DOING_AJAX' ) && true === DOING_AJAX && -
trunk/src/bp-templates/bp-nouveau/includes/blogs/ajax.php
r12082 r13878 10 10 defined( 'ABSPATH' ) || exit; 11 11 12 add_action( 'admin_init', function () {12 add_action( 'admin_init', function () { 13 13 $ajax_actions = array( 14 14 array( -
trunk/src/bp-templates/bp-nouveau/includes/blogs/functions.php
r13503 r13878 185 185 function bp_nouveau_get_blog_signup_inline_script() { 186 186 return ' 187 ( function ( $ ) {187 ( function ( $ ) { 188 188 if ( $( \'body\' ).hasClass( \'register\' ) ) { 189 189 var blog_checked = $( \'#signup_with_blog\' ); … … 195 195 196 196 // toggle "Blog Details" block whenever checkbox is checked 197 blog_checked.change( function ( event ) {197 blog_checked.change( function ( event ) { 198 198 // Toggle HTML5 required attribute. 199 $.each( $( \'#blog-details\' ).find( \'[aria-required]\' ), function ( i, input ) {199 $.each( $( \'#blog-details\' ).find( \'[aria-required]\' ), function ( i, input ) { 200 200 $( input ).prop( \'required\', $( event.target ).prop( \'checked\' ) ); 201 201 } ); -
trunk/src/bp-templates/bp-nouveau/includes/blogs/loader.php
r13461 r13878 53 53 // Load AJAX code only on AJAX requests. 54 54 } else { 55 add_action( 'admin_init', function () {55 add_action( 'admin_init', function () { 56 56 if ( defined( 'DOING_AJAX' ) && true === DOING_AJAX && 0 === strpos( $_REQUEST['action'], 'blogs_' ) ) { 57 57 require bp_nouveau()->blogs->dir . 'ajax.php'; … … 74 74 } 75 75 76 add_action( 'bp_nouveau_enqueue_scripts', function () {76 add_action( 'bp_nouveau_enqueue_scripts', function () { 77 77 if ( bp_get_blog_signup_allowed() && bp_is_register_page() ) { 78 78 wp_add_inline_script( 'bp-nouveau', bp_nouveau_get_blog_signup_inline_script() ); -
trunk/src/bp-templates/bp-nouveau/includes/friends/ajax.php
r12094 r13878 10 10 defined( 'ABSPATH' ) || exit; 11 11 12 add_action( 'admin_init', function () {12 add_action( 'admin_init', function () { 13 13 $ajax_actions = array( 14 14 array( -
trunk/src/bp-templates/bp-nouveau/includes/friends/loader.php
r13461 r13878 50 50 // Load AJAX code only on AJAX requests. 51 51 } else { 52 add_action( 'admin_init', function () {52 add_action( 'admin_init', function () { 53 53 if ( defined( 'DOING_AJAX' ) && true === DOING_AJAX && 0 === strpos( $_REQUEST['action'], 'friends_' ) ) { 54 54 require bp_nouveau()->friends->dir . 'ajax.php'; -
trunk/src/bp-templates/bp-nouveau/includes/groups/ajax.php
r13862 r13878 10 10 defined( 'ABSPATH' ) || exit; 11 11 12 add_action( 'admin_init', function () {12 add_action( 'admin_init', function () { 13 13 $ajax_actions = array( 14 14 array( 'groups_filter' => array( 'function' => 'bp_nouveau_ajax_object_template_loader', 'nopriv' => true ) ), -
trunk/src/bp-templates/bp-nouveau/includes/groups/loader.php
r13652 r13878 55 55 // Load AJAX code only on AJAX requests. 56 56 } else { 57 add_action( 'admin_init', function () {57 add_action( 'admin_init', function () { 58 58 if ( defined( 'DOING_AJAX' ) && true === DOING_AJAX && 0 === strpos( $_REQUEST['action'], 'groups_' ) ) { 59 59 require bp_nouveau()->groups->dir . 'ajax.php'; -
trunk/src/bp-templates/bp-nouveau/includes/messages/ajax.php
r13510 r13878 10 10 defined( 'ABSPATH' ) || exit; 11 11 12 add_action( 'admin_init', function () {12 add_action( 'admin_init', function () { 13 13 $ajax_actions = array( 14 14 array( … … 138 138 * @param array $value Array of un-trimmed usernames submitted. 139 139 */ 140 $recipients = apply_filters( 'bp_messages_recipients', array_map( function ( $username ) {140 $recipients = apply_filters( 'bp_messages_recipients', array_map( function ( $username ) { 141 141 return trim( $username, '@' ); 142 142 }, $_POST['send_to'] ) ); -
trunk/src/bp-templates/bp-nouveau/includes/messages/loader.php
r13481 r13878 53 53 // Load AJAX code only on AJAX requests. 54 54 } else { 55 add_action( 'admin_init', function () {55 add_action( 'admin_init', function () { 56 56 if ( defined( 'DOING_AJAX' ) && true === DOING_AJAX && 0 === strpos( $_REQUEST['action'], 'messages_' ) ) { 57 57 require bp_nouveau()->messages->dir . 'ajax.php'; -
trunk/src/bp-xprofile/bp-xprofile-admin.php
r13806 r13878 1234 1234 1235 1235 // Sort these fields types alphabetically. 1236 uasort( $fields, function ( $a, $b ) { return strnatcmp( $a[1]->name, $b[1]->name ); } );1236 uasort( $fields, function ( $a, $b ) { return strnatcmp( $a[1]->name, $b[1]->name ); } ); 1237 1237 1238 1238 foreach ( $fields as $field_type_obj ) { -
trunk/src/bp-xprofile/bp-xprofile-filters.php
r13806 r13878 426 426 $values = explode( ';', $field_value ); 427 427 428 array_walk( $values, function ( &$value, $key ) use ( $field_type, $field ) {428 array_walk( $values, function ( &$value, $key ) use ( $field_type, $field ) { 429 429 $value = bp_xprofile_escape_field_data( $value, $field_type, $field->id ); 430 430 } ); … … 480 480 481 481 // Locate comment authors with WP accounts. 482 foreach ( (array) $comments as $comment ) {482 foreach ( (array) $comments as $comment ) { 483 483 if ( $comment->user_id ) { 484 484 $user_ids[] = $comment->user_id; … … 493 493 // Pull up the xprofile fullname of each commenter. 494 494 if ( $fullnames = bp_core_get_user_displaynames( $user_ids ) ) { 495 foreach ( (array) $fullnames as $user_id => $user_fullname ) {495 foreach ( (array) $fullnames as $user_id => $user_fullname ) { 496 496 $users[ $user_id ] = trim( stripslashes( $user_fullname ) ); 497 497 } … … 499 499 500 500 // Loop through and match xprofile fullname with commenters. 501 foreach ( (array) $comments as $i => $comment ) {501 foreach ( (array) $comments as $i => $comment ) { 502 502 if ( ! empty( $comment->user_id ) ) { 503 503 if ( ! empty( $users[ $comment->user_id ] ) ) { -
trunk/src/bp-xprofile/bp-xprofile-functions.php
r13756 r13878 394 394 if ( is_array( $values ) ) { 395 395 $data = array(); 396 foreach ( (array) $values as $value ) {396 foreach ( (array) $values as $value ) { 397 397 398 398 /** … … 763 763 * 764 764 * @since 2.0.0 765 * 765 * 766 766 * @global wpdb $wpdb WordPress database object. 767 767 * … … 963 963 * 964 964 * @since 1.5.0 965 * 965 * 966 966 * @global wpdb $wpdb WordPress database object. 967 967 * … … 1146 1146 * 1147 1147 * @since 2.0.0 1148 * 1148 * 1149 1149 * @global wpdb $wpdb WordPress database object. 1150 1150 * … … 1359 1359 $default_visibility_levels = BP_XProfile_Group::fetch_default_visibility_levels(); 1360 1360 1361 foreach ( (array) $default_visibility_levels as $d_field_id => $defaults ) {1361 foreach ( (array) $default_visibility_levels as $d_field_id => $defaults ) { 1362 1362 // If the admin has forbidden custom visibility levels for this field, replace 1363 1363 // the user-provided setting with the default specified by the admin. … … 1368 1368 1369 1369 $field_ids = array(); 1370 foreach ( $user_visibility_levels as $field_id => $field_visibility ) {1370 foreach ( $user_visibility_levels as $field_id => $field_visibility ) { 1371 1371 if ( in_array( $field_visibility, $levels ) ) { 1372 1372 $field_ids[] = $field_id; … … 1477 1477 * 1478 1478 * @since 8.0.0 1479 * 1479 * 1480 1480 * @global wpdb $wpdb WordPress database object. 1481 1481 * -
trunk/src/bp-xprofile/bp-xprofile-template.php
r13844 r13878 1376 1376 <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> 1377 1377 1378 <?php foreach ( bp_xprofile_get_visibility_levels() as $level ) : ?>1378 <?php foreach ( bp_xprofile_get_visibility_levels() as $level ) : ?> 1379 1379 1380 1380 <?php -
trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php
r13806 r13878 148 148 // Check for updated posted values, but errors preventing them from 149 149 // being saved first time. 150 foreach ( $option_values as $i => $option_value ) {150 foreach ( $option_values as $i => $option_value ) { 151 151 if ( isset( $_POST[ 'field_' . $this->field_obj->id ] ) && $_POST[ 'field_' . $this->field_obj->id ][ $i ] != $option_value ) { 152 152 if ( ! empty( $_POST[ 'field_' . $this->field_obj->id ][ $i ] ) ) { -
trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php
r13806 r13878 117 117 // Check for updated posted values, but errors preventing them from 118 118 // being saved first time. 119 foreach ( $option_values as $i => $option_value ) {119 foreach ( $option_values as $i => $option_value ) { 120 120 if ( isset( $_POST[ 'field_' . $this->field_obj->id ] ) && $_POST[ 'field_' . $this->field_obj->id ] != $option_value ) { 121 121 if ( ! empty( $_POST[ 'field_' . $this->field_obj->id ] ) ) { -
trunk/src/bp-xprofile/classes/class-bp-xprofile-field.php
r13806 r13878 1652 1652 <select name="default-visibility" id="default-visibility"> 1653 1653 1654 <?php foreach ( bp_xprofile_get_visibility_levels() as $level ) : ?>1654 <?php foreach ( bp_xprofile_get_visibility_levels() as $level ) : ?> 1655 1655 1656 1656 <option value="<?php echo esc_attr( $level['id'] ); ?>" <?php selected( $this->get_default_visibility(), $level['id'] ); ?>> -
trunk/src/bp-xprofile/classes/class-bp-xprofile-group.php
r13797 r13878 325 325 $field_ids = self::get_group_field_ids( $group_ids, $r ); 326 326 327 foreach ( $groups as $group ) {327 foreach ( $groups as $group ) { 328 328 $group->fields = array(); 329 329 } … … 381 381 382 382 // Loop through the results and find the fields that have data. 383 foreach ( (array) $field_data as $data ) {383 foreach ( (array) $field_data as $data ) { 384 384 385 385 // Empty fields may contain a serialized empty array. … … 395 395 396 396 // The remaining members of $field_ids are empty. Remove them. 397 foreach ( $fields as $field_key => $field ) {397 foreach ( $fields as $field_key => $field ) { 398 398 if ( in_array( $field->id, $field_ids ) ) { 399 399 unset( $fields[ $field_key ] ); … … 409 409 410 410 // Loop through fields. 411 foreach ( (array) $fields as $field_key => $field ) {411 foreach ( (array) $fields as $field_key => $field ) { 412 412 413 413 // Loop through the data in each field. 414 foreach ( (array) $field_data as $data ) {414 foreach ( (array) $field_data as $data ) { 415 415 416 416 // Assign correct data value to the field. … … 439 439 440 440 // Merge the field array back in with the group array. 441 foreach ( (array) $groups as $group ) {441 foreach ( (array) $groups as $group ) { 442 442 // Indexes may have been shifted after previous deletions, so we get a 443 443 // fresh one each time through the loop. 444 444 $index = array_search( $group, $groups ); 445 445 446 foreach ( (array) $fields as $field ) {446 foreach ( (array) $fields as $field ) { 447 447 if ( $group->id === $field->group_id ) { 448 448 $groups[ $index ]->fields[] = $field; … … 757 757 $visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true ); 758 758 759 foreach ( (array) $fields as $key => $field ) {759 foreach ( (array) $fields as $key => $field ) { 760 760 761 761 // Does the admin allow this field to be customized? -
trunk/tests/phpunit/includes/loader.php
r12712 r13878 26 26 $components = array( 'activity', 'blogs', 'friends', 'groups', 'members', 'messages', 'notifications', 'settings', 'xprofile' ); 27 27 foreach ( $components as $component ) { 28 add_action( "bp_{$component}_includes", function () use ( $component ) {28 add_action( "bp_{$component}_includes", function () use ( $component ) { 29 29 $dirs = array( 30 30 buddypress()->plugin_dir . 'bp-' . $component . '/actions/', -
trunk/tests/phpunit/testcases/core/class-bp-user-query.php
r13314 r13878 176 176 ) ); 177 177 178 add_filter( 'bp_user_query_online_interval', function () { return 5; } );178 add_filter( 'bp_user_query_online_interval', function () { return 5; } ); 179 179 180 180 $q = new BP_User_Query( array(
Note: See TracChangeset
for help on using the changeset viewer.