Changeset 7057
- Timestamp:
- 01/27/2020 11:36:04 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/extend/buddypress/groups.php
r7006 r7057 716 716 $forum_ids = bbp_get_group_forum_ids( $group_id ); 717 717 718 // Use the first forum ID718 // Bail if no forum IDs available 719 719 if ( empty( $forum_ids ) ) { 720 720 return; … … 1164 1164 1165 1165 /** 1166 * Prevent Forum Parent from appearing1166 * Make Forum Parent a hidden field instead of a selectable one. 1167 1167 * 1168 1168 * @since 2.1.0 bbPress (r3746) … … 1177 1177 1178 1178 /** 1179 * Prevent Topic Parent from appearing1179 * Output a dropdown for picking which group forum this topic is for. 1180 1180 * 1181 1181 * @since 2.1.0 bbPress (r3746) … … 1183 1183 public function topic_parent() { 1184 1184 1185 $forum_ids = bbp_get_group_forum_ids( bp_get_current_group_id() ); ?> 1185 // Get the group ID 1186 $gid = bp_get_current_group_id(); 1187 1188 // Get the forum IDs for this group 1189 $forum_ids = bbp_get_group_forum_ids( $gid ); 1190 1191 // Attempt to get the current topic forum ID 1192 $topic_id = bbp_get_topic_id(); 1193 $forum_id = bbp_get_topic_forum_id( $topic_id ); 1194 1195 // Setup the query arguments - note that these may be overridden later 1196 // by various bbPress visibility and capability filters. 1197 $args = array( 1198 'post_type' => bbp_get_forum_post_type(), 1199 'post_status' => bbp_get_public_status_id(), 1200 'include' => $forum_ids, 1201 'numberposts' => -1, 1202 'orderby' => 'menu_order', 1203 'order' => 'ASC', 1204 ); 1205 1206 // Get the forum objects for these forum IDs 1207 $forums = get_posts( $args ); 1208 1209 // Setup the dropdown arguments 1210 $dd_args = array( 1211 'posts' => $forums, 1212 'selected' => $forum_id, 1213 ); ?> 1186 1214 1187 1215 <p> 1188 1216 <label for="bbp_forum_id"><?php esc_html_e( 'Forum:', 'bbpress' ); ?></label><br /> 1189 <?php bbp_dropdown( array( 'include' => $forum_ids, 'selected' => bbp_get_form_topic_forum() )); ?>1217 <?php bbp_dropdown( $dd_args ); ?> 1190 1218 </p> 1191 1219
Note: See TracChangeset
for help on using the changeset viewer.