Changeset 6415 for trunk/src/includes/extend/buddypress/functions.php
- Timestamp:
- 05/19/2017 03:25:37 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/extend/buddypress/functions.php
r6370 r6415 341 341 } 342 342 343 // Make sure result is an array 344 if ( ! is_array( $forum_ids ) ) { 345 $forum_ids = (array) $forum_ids; 346 } 347 348 // Trim out any empty array items 349 $forum_ids = array_filter( $forum_ids ); 350 343 // Make sure result is an array of ints 344 $forum_ids = array_filter( wp_parse_id_list( $forum_ids ) ); 345 346 // Filter & return 351 347 return (array) apply_filters( 'bbp_get_group_forum_ids', $forum_ids, $group_id ); 352 348 } … … 373 369 } 374 370 375 // Make sure result is an array 376 if ( ! is_array( $group_ids ) ) { 377 $group_ids = (array) $group_ids; 378 } 379 380 // Trim out any empty array items 381 $group_ids = array_filter( $group_ids ); 382 371 // Make sure result is an array of ints 372 $group_ids = array_filter( wp_parse_id_list( $group_ids ) ); 373 374 // Filter & return 383 375 return (array) apply_filters( 'bbp_get_forum_group_ids', $group_ids, $forum_id ); 384 376 } … … 398 390 399 391 // Trim out any empties 400 $forum_ids = array_filter( $forum_ids);392 $forum_ids = array_filter( wp_parse_id_list( $forum_ids ) ); 401 393 402 394 // Get the forums … … 414 406 415 407 // Trim out any empties 416 $group_ids = array_filter( $group_ids);408 $group_ids = array_filter( wp_parse_id_list( $group_ids ) ); 417 409 418 410 // Get the forums … … 440 432 441 433 // Maybe update the groups forums 442 if ( ! in_array( $group_id, $group_ids ) ) {434 if ( ! in_array( $group_id, $group_ids, true ) ) { 443 435 $group_ids[] = $group_id; 444 436 return bbp_update_forum_group_ids( $forum_id, $group_ids ); … … 466 458 467 459 // Maybe update the groups forums 468 if ( ! in_array( $forum_id, $forum_ids ) ) {460 if ( ! in_array( $forum_id, $forum_ids, true ) ) { 469 461 $forum_ids[] = $forum_id; 470 462 return bbp_update_group_forum_ids( $group_id, $forum_ids ); … … 492 484 493 485 // Maybe update the groups forums 494 if ( in_array( $group_id, $group_ids ) ) {486 if ( in_array( $group_id, $group_ids, true ) ) { 495 487 $group_ids = array_diff( array_values( $group_ids ), (array) $group_id ); 496 488 return bbp_update_forum_group_ids( $forum_id, $group_ids ); … … 518 510 519 511 // Maybe update the groups forums 520 if ( in_array( $forum_id, $forum_ids ) ) {512 if ( in_array( $forum_id, $forum_ids, true ) ) { 521 513 $forum_ids = array_diff( array_values( $forum_ids ), (array) $forum_id ); 522 514 return bbp_update_group_forum_ids( $group_id, $forum_ids ); … … 541 533 542 534 // Loop through forums and remove this group from each one 543 foreach ( (array)$forum_ids as $forum_id ) {535 foreach ( $forum_ids as $forum_id ) { 544 536 bbp_remove_group_id_from_forum( $group_id, $forum_id ); 545 537 } … … 559 551 560 552 // Loop through groups and remove this forum from each one 561 foreach ( (array)$group_ids as $group_id ) {553 foreach ( $group_ids as $group_id ) { 562 554 bbp_remove_forum_id_from_group( $forum_id, $group_id ); 563 555 }
Note: See TracChangeset
for help on using the changeset viewer.