Changeset 5441 for trunk/src/includes/extend/buddypress/groups.php
- Timestamp:
- 07/10/2014 03:54:41 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/extend/buddypress/groups.php
r5416 r5441 179 179 180 180 // Bail if not viewing a single group 181 if ( ! bp_is_group() ) 181 if ( ! bp_is_group() ) { 182 182 return; 183 } 183 184 184 185 // Are forums enabled for this group? … … 328 329 329 330 // Bail if not a POST action 330 if ( ! bbp_is_post_request() ) 331 if ( ! bbp_is_post_request() ) { 331 332 return; 333 } 332 334 333 335 // Admin Nonce check … … 466 468 467 469 // Bail if not looking at this screen 468 if ( !bp_is_group_creation_step( $this->slug ) ) 470 if ( !bp_is_group_creation_step( $this->slug ) ) { 469 471 return false; 472 } 470 473 471 474 // Check for possibly empty group_id … … 509 512 $forum_ids = bbp_get_group_forum_ids( $group_id ); 510 513 511 if ( !empty( $forum_ids ) ) 514 if ( !empty( $forum_ids ) ) { 512 515 $forum_id = (int) is_array( $forum_ids ) ? $forum_ids[0] : $forum_ids; 516 } 513 517 514 518 // Create a forum, or not … … 517 521 518 522 // Bail if initial content was already created 519 if ( !empty( $forum_id ) ) 523 if ( !empty( $forum_id ) ) { 520 524 return; 525 } 521 526 522 527 // Set the default forum status … … 605 610 606 611 // Bail if no forum_id was passed 607 if ( empty( $forum_args['forum_id'] ) ) 612 if ( empty( $forum_args['forum_id'] ) ) { 608 613 return; 614 } 609 615 610 616 // Validate forum_id … … 631 637 632 638 // Bail if no forum_id was passed 633 if ( empty( $forum_args['forum_id'] ) ) 639 if ( empty( $forum_args['forum_id'] ) ) { 634 640 return; 641 } 635 642 636 643 // Validate forum_id … … 662 669 663 670 // Use the first forum ID 664 if ( empty( $forum_ids ) ) 671 if ( empty( $forum_ids ) ) { 665 672 return; 673 } 666 674 667 675 // Get the first forum ID … … 689 697 690 698 // Bail if group cannot be found 691 if ( empty( $group ) ) 699 if ( empty( $group ) ) { 692 700 return false; 701 } 693 702 694 703 // Set forum enabled status … … 1033 1042 1034 1043 // If this is a group of any kind, empty out the redirect URL 1035 if ( bp_is_group_admin_screen( $this->slug ) ) 1044 if ( bp_is_group_admin_screen( $this->slug ) ) { 1036 1045 $redirect_url = trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/' . $this->slug ); 1046 } 1037 1047 1038 1048 return $redirect_url; … … 1132 1142 1133 1143 // if a forum is not enabled, we don't need to add this field 1134 if ( ! bp_group_is_forum_enabled() ) 1135 return; ?> 1144 if ( ! bp_group_is_forum_enabled() ) { 1145 return; 1146 } ?> 1136 1147 1137 1148 <input type="hidden" name="group-show-forum" id="group-show-forum" value="1" /> … … 1197 1208 1198 1209 // Bail if the post isn't associated with a group 1199 if ( empty( $group_ids ) ) 1210 if ( empty( $group_ids ) ) { 1200 1211 return $url; 1212 } 1201 1213 1202 1214 // @todo Multiple group forums/forum groups … … 1268 1280 $new = $this->maybe_map_permalink_to_group( $reply_id ); 1269 1281 1270 if ( empty( $new ) ) 1282 if ( empty( $new ) ) { 1271 1283 return $url; 1284 } 1272 1285 1273 1286 return trailingslashit( $new ) . bbpress()->edit_id . '/'; … … 1334 1347 $new = $this->maybe_map_permalink_to_group( bbp_get_forum_id() ); 1335 1348 1336 if ( empty( $new ) ) 1349 if ( empty( $new ) ) { 1337 1350 return $args; 1351 } 1338 1352 1339 1353 global $wp_rewrite; … … 1357 1371 public function replies_pagination( $args ) { 1358 1372 $new = $this->maybe_map_permalink_to_group( bbp_get_topic_id() ); 1359 if ( empty( $new ) ) 1373 if ( empty( $new ) ) { 1360 1374 return $args; 1375 } 1361 1376 1362 1377 global $wp_rewrite; … … 1393 1408 1394 1409 // Bail if not a group forum 1395 if ( empty( $group_ids ) ) 1410 if ( empty( $group_ids ) ) { 1396 1411 return; 1412 } 1397 1413 1398 1414 // Use the first group ID … … 1428 1444 1429 1445 // Not posting from a BuddyPress group? stop now! 1430 if ( empty( $group ) ) 1446 if ( empty( $group ) ) { 1431 1447 return $args; 1448 } 1432 1449 1433 1450 // Set the component to 'groups' so the activity item shows up in the group
Note: See TracChangeset
for help on using the changeset viewer.