Changeset 7378 for trunk/src/includes/extend/buddypress/groups.php
- Timestamp:
- 11/22/2025 06:05:25 AM (7 months ago)
- File:
-
- 1 edited
-
trunk/src/includes/extend/buddypress/groups.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/extend/buddypress/groups.php
r7372 r7378 605 605 606 606 // Create the initial forum 607 $forum_id = bbp_insert_forum( array( 608 'post_parent' => bbp_get_group_forums_root_id(), 609 'post_title' => $group->name, 610 'post_content' => $group->description, 611 'post_status' => $status 612 ) ); 607 $forum_id = bbp_insert_forum( 608 array( 609 'post_parent' => bbp_get_group_forums_root_id(), 610 'post_title' => $group->name, 611 'post_content' => $group->description, 612 'post_status' => $status 613 ) 614 ); 613 615 614 616 // Setup forum args with forum ID … … 739 741 740 742 // Create the initial forum 741 $forum_id = bbp_insert_forum( array( 742 'post_parent' => bbp_get_group_forums_root_id(), 743 'post_title' => bp_get_new_group_name(), 744 'post_content' => bp_get_new_group_description(), 745 'post_status' => $status 746 ) ); 743 $forum_id = bbp_insert_forum( 744 array( 745 'post_parent' => bbp_get_group_forums_root_id(), 746 'post_title' => bp_get_new_group_name(), 747 'post_content' => bp_get_new_group_description(), 748 'post_status' => $status 749 ) 750 ); 747 751 748 752 // Run the BP-specific functions for new groups … … 812 816 // Validate forum_id 813 817 $forum_id = bbp_get_forum_id( $forum_args['forum_id'] ); 814 $group_id = ! empty( $forum_args['group_id'] ) ? $forum_args['group_id'] : bp_get_current_group_id(); 818 $group_id = ! empty( $forum_args['group_id'] ) 819 ? $forum_args['group_id'] 820 : bp_get_current_group_id(); 815 821 816 822 bbp_add_forum_id_to_group( $group_id, $forum_id ); … … 836 842 // Validate forum_id 837 843 $forum_id = bbp_get_forum_id( $forum_args['forum_id'] ); 838 $group_id = ! empty( $forum_args['group_id'] ) ? $forum_args['group_id'] : bp_get_current_group_id(); 844 $group_id = ! empty( $forum_args['group_id'] ) 845 ? $forum_args['group_id'] 846 : bp_get_current_group_id(); 839 847 840 848 bbp_remove_forum_id_from_group( $group_id, $forum_id ); … … 865 873 866 874 // Get the first forum ID 867 $forum_id = (int) is_array( $forum_ids ) ? $forum_ids[0] : $forum_ids; 868 $this->remove_forum( array( 869 'forum_id' => $forum_id, 870 'group_id' => $group_id 871 ) ); 875 $forum_id = (int) is_array( $forum_ids ) 876 ? $forum_ids[0] 877 : $forum_ids; 878 879 $this->remove_forum( 880 array( 881 'forum_id' => $forum_id, 882 'group_id' => $group_id 883 ) 884 ); 872 885 } 873 886 … … 1017 1030 1018 1031 // Always load up the group forum 1019 bbp_has_forums( array( 1020 'p' => $forum_id, 1021 'post_parent' => null 1022 ) ); 1032 bbp_has_forums( 1033 array( 1034 'p' => $forum_id, 1035 'post_parent' => null 1036 ) 1037 ); 1023 1038 1024 1039 // Set the global forum ID … … 1077 1092 1078 1093 // Get the topic 1079 bbp_has_topics( array( 1080 'name' => bp_action_variable( $offset + 1 ), 1081 'posts_per_page' => 1, 1082 'show_stickies' => false 1083 ) ); 1094 bbp_has_topics( 1095 array( 1096 'name' => bp_action_variable( $offset + 1 ), 1097 'posts_per_page' => 1, 1098 'show_stickies' => false 1099 ) 1100 ); 1084 1101 1085 1102 // If no topic, 404 … … 1152 1169 1153 1170 // Get the reply 1154 bbp_has_replies( array( 1155 'name' => bp_action_variable( $offset + 1 ), 1156 'posts_per_page' => 1 1157 ) ); 1171 bbp_has_replies( 1172 array( 1173 'name' => bp_action_variable( $offset + 1 ), 1174 'posts_per_page' => 1 1175 ) 1176 ); 1158 1177 1159 1178 // If no topic, 404 … … 1208 1227 1209 1228 // Reset the query 1229 // phpcs:ignore WordPress.WP.DiscouragedFunctions.wp_reset_query_wp_reset_query 1210 1230 wp_reset_query(); ?> 1211 1231
Note: See TracChangeset
for help on using the changeset viewer.