Changeset 3505 for branches/plugin/bbp-includes/bbp-forum-template.php
- Timestamp:
- 09/10/2011 10:27:19 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-forum-template.php
r3496 r3505 62 62 63 63 // Setup possible post__not_in array 64 $post_stati[] = 'publish';64 $post_stati[] = bbp_get_public_status_id(); 65 65 66 66 // Super admin get whitelisted post statuses 67 67 if ( is_super_admin() ) { 68 $post_stati = array( 'publish', 'private', 'hidden');68 $post_stati = array( bbp_get_public_status_id(), bbp_get_private_status_id(), bbp_get_hidden_status_id() ); 69 69 70 70 // Not a super admin, so check caps … … 73 73 // Check if user can read private forums 74 74 if ( current_user_can( 'read_private_forums' ) ) 75 $post_stati[] = 'private';75 $post_stati[] = bbp_get_private_status_id(); 76 76 77 77 // Check if user can read hidden forums 78 78 if ( current_user_can( 'read_hidden_forums' ) ) 79 $post_stati[] = 'hidden';79 $post_stati[] = bbp_get_hidden_status_id(); 80 80 } 81 81 … … 580 580 581 581 // Setup possible post__not_in array 582 $post_stati[] = 'publish';582 $post_stati[] = bbp_get_public_status_id(); 583 583 584 584 // Super admin get whitelisted post statuses 585 585 if ( is_super_admin() ) { 586 $post_stati = array( 'publish', 'private', 'hidden');586 $post_stati = array( bbp_get_public_status_id(), bbp_get_private_status_id(), bbp_get_hidden_status_id() ); 587 587 588 588 // Not a super admin, so check caps … … 591 591 // Check if user can read private forums 592 592 if ( current_user_can( 'read_private_forums' ) ) 593 $post_stati[] = 'private';593 $post_stati[] = bbp_get_private_status_id(); 594 594 595 595 // Check if user can read hidden forums 596 596 if ( current_user_can( 'read_hidden_forums' ) ) 597 $post_stati[] = 'hidden';597 $post_stati[] = bbp_get_hidden_status_id(); 598 598 } 599 599 … … 636 636 */ 637 637 function bbp_list_forums( $args = '' ) { 638 global $bbp;639 638 640 639 // Define used variables … … 1077 1076 */ 1078 1077 function bbp_get_forum_topics_link( $forum_id = 0 ) { 1079 global $bbp;1080 1078 1081 1079 $forum = bbp_get_forum( bbp_get_forum_id( (int) $forum_id ) ); … … 1375 1373 */ 1376 1374 function bbp_is_forum_closed( $forum_id = 0, $check_ancestors = true ) { 1377 global $bbp; 1378 1379 $forum_id = bbp_get_forum_id( $forum_id ); 1380 $retval = ( $bbp->closed_status_id == bbp_get_forum_status( $forum_id ) ); 1375 1376 $forum_id = bbp_get_forum_id( $forum_id ); 1377 $retval = ( bbp_get_closed_status_id() == bbp_get_forum_status( $forum_id ) ); 1381 1378 1382 1379 if ( !empty( $check_ancestors ) ) { … … 1408 1405 */ 1409 1406 function bbp_is_forum_public( $forum_id = 0, $check_ancestors = true ) { 1410 global $bbp;1411 1407 1412 1408 $forum_id = bbp_get_forum_id( $forum_id ); … … 1414 1410 1415 1411 // If post status is public, return true 1416 $retval = ( 'publish'== $visibility );1412 $retval = ( bbp_get_public_status_id() == $visibility ); 1417 1413 1418 1414 // Check ancestors and inherit their privacy setting for display … … 1445 1441 */ 1446 1442 function bbp_is_forum_private( $forum_id = 0, $check_ancestors = true ) { 1447 global $bbp;1448 1443 1449 1444 $forum_id = bbp_get_forum_id( $forum_id ); … … 1451 1446 1452 1447 // If post status is private, return true 1453 $retval = ( 'private'== $visibility );1448 $retval = ( bbp_get_private_status_id() == $visibility ); 1454 1449 1455 1450 // Check ancestors and inherit their privacy setting for display … … 1482 1477 */ 1483 1478 function bbp_is_forum_hidden( $forum_id = 0, $check_ancestors = true ) { 1484 global $bbp;1485 1479 1486 1480 $forum_id = bbp_get_forum_id( $forum_id ); … … 1488 1482 1489 1483 // If post status is private, return true 1490 $retval = ( 'hidden'== $visibility );1484 $retval = ( bbp_get_hidden_status_id() == $visibility ); 1491 1485 1492 1486 // Check ancestors and inherit their privacy setting for display
Note: See TracChangeset
for help on using the changeset viewer.