Changeset 4485
- Timestamp:
- 11/23/2012 11:13:27 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/common/template-tags.php
r4484 r4485 1248 1248 /** Arguments *********************************************************/ 1249 1249 1250 $ defaults = array(1250 $r = bbp_parse_args( $args, array( 1251 1251 'post_type' => bbp_get_forum_post_type(), 1252 1252 'selected' => 0, … … 1266 1266 'disable_categories' => true, 1267 1267 'disabled' => '' 1268 ); 1269 $r = bbp_parse_args( $args, $defaults, 'get_dropdown' ); 1268 ), 'get_dropdown' ); 1270 1269 1271 1270 if ( empty( $r['walker'] ) ) { … … 1275 1274 1276 1275 // Force 0 1277 if ( is_numeric( $r['selected'] ) && $r['selected'] < 0 ) 1276 if ( is_numeric( $r['selected'] ) && $r['selected'] < 0 ) { 1278 1277 $r['selected'] = 0; 1279 1280 extract( $r ); 1278 } 1281 1279 1282 1280 // Unset the args not needed for WP_Query to avoid any possible conflicts. … … 1293 1291 1294 1292 // Forums 1295 if ( bbp_get_forum_post_type() == $ post_type) {1293 if ( bbp_get_forum_post_type() == $r['post_type'] ) { 1296 1294 1297 1295 // Private forums … … 1311 1309 /** Setup variables ***************************************************/ 1312 1310 1313 $name = esc_attr( $ select_id);1311 $name = esc_attr( $r['select_id'] ); 1314 1312 $select_id = $name; 1315 $tab = (int) $ tab;1313 $tab = (int) $r['tab']; 1316 1314 $retval = ''; 1317 1315 $posts = get_posts( $r ); 1318 $disabled = disabled( isset( bbpress()->options[$ disabled] ), true, false );1316 $disabled = disabled( isset( bbpress()->options[$r['disabled']] ), true, false ); 1319 1317 1320 1318 /** Drop Down *********************************************************/ … … 1322 1320 // Items found 1323 1321 if ( !empty( $posts ) ) { 1324 if ( empty( $ options_only) ) {1322 if ( empty( $r['options_only'] ) ) { 1325 1323 $tab = !empty( $tab ) ? ' tabindex="' . $tab . '"' : ''; 1326 1324 $retval .= '<select name="' . $name . '" id="' . $select_id . '"' . $tab . $disabled . '>' . "\n"; 1327 1325 } 1328 1326 1329 $retval .= !empty( $ show_none ) ? "\t<option value=\"\" class=\"level-0\">" . $show_none. '</option>' : '';1327 $retval .= !empty( $r['show_none'] ) ? "\t<option value=\"\" class=\"level-0\">" . $r['show_none'] . '</option>' : ''; 1330 1328 $retval .= walk_page_dropdown_tree( $posts, 0, $r ); 1331 1329 1332 if ( empty( $ options_only ) )1330 if ( empty( $r['options_only'] ) ) { 1333 1331 $retval .= '</select>'; 1332 } 1334 1333 1335 1334 // No items found - Display feedback if no custom message was passed 1336 } elseif ( empty( $ none_found) ) {1335 } elseif ( empty( $r['none_found'] ) ) { 1337 1336 1338 1337 // Switch the response based on post type 1339 switch ( $ post_type) {1338 switch ( $r['post_type'] ) { 1340 1339 1341 1340 // Topics
Note: See TracChangeset
for help on using the changeset viewer.