Changeset 5010
- Timestamp:
- 07/10/2013 04:29:09 AM (11 years ago)
- Location:
- trunk/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/common/template-tags.php
r5005 r5010 1318 1318 * box, the first value would of course be selected - 1319 1319 * though you can have that as none (pass 'show_none' arg)) 1320 * - sort_column: Sort by? Defaults to 'menu_order, post_title'1320 * - orderby: Defaults to 'menu_order title' 1321 1321 * - post_parent: Post parent. Defaults to 0 1322 1322 * - post_status: Which all post_statuses to find in? Can be an array … … 1357 1357 $r = bbp_parse_args( $args, array( 1358 1358 'post_type' => bbp_get_forum_post_type(), 1359 'post_parent' => null, 1360 'post_status' => null, 1359 1361 'selected' => 0, 1360 'sort_column' => 'menu_order',1361 1362 'exclude' => array(), 1362 'post_parent' => null,1363 1363 'numberposts' => -1, 1364 'orderby' => 'menu_order ',1364 'orderby' => 'menu_order title', 1365 1365 'order' => 'ASC', 1366 1366 'walker' => '', … … 1391 1391 } 1392 1392 1393 /** Post Status *******************************************************/1394 1395 // Define local variable(s)1396 $post_stati = array();1397 1398 // Public1399 $post_stati[] = bbp_get_public_status_id();1400 1401 // Forums1402 if ( bbp_get_forum_post_type() === $r['post_type'] ) {1403 1404 // Private forums1405 if ( current_user_can( 'read_private_forums' ) ) {1406 $post_stati[] = bbp_get_private_status_id();1407 }1408 1409 // Hidden forums1410 if ( current_user_can( 'read_hidden_forums' ) ) {1411 $post_stati[] = bbp_get_hidden_status_id();1412 }1413 }1414 1415 // Setup the post statuses1416 $r['post_status'] = implode( ',', $post_stati );1417 1418 1393 /** Setup variables ***************************************************/ 1419 1394 … … 1422 1397 'post_type' => $r['post_type'], 1423 1398 'post_status' => $r['post_status'], 1424 'sort_column' => $r['sort_column'],1425 1399 'exclude' => $r['exclude'], 1426 1400 'post_parent' => $r['post_parent'], -
trunk/includes/forums/functions.php
r5006 r5010 1695 1695 1696 1696 // Add the statuses 1697 $posts_query->set( 'post_status', $post_stati);1697 $posts_query->set( 'post_status', array_unique( array_filter( $post_stati ) ) ); 1698 1698 } 1699 1699
Note: See TracChangeset
for help on using the changeset viewer.