Changeset 3434
- Timestamp:
- 08/21/2011 01:27:05 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-core-compatibility.php
r3429 r3434 1514 1514 1515 1515 // Set bbp_user_id for future reference 1516 $posts_query-> query_vars['bbp_user_id'] = $user->ID;1516 $posts_query->set( 'bbp_user_id', $user->ID ); 1517 1517 1518 1518 // Set author_name as current user's nicename to get correct posts 1519 1519 if ( !bbp_is_query_name( 'bbp_widget' ) ) 1520 $posts_query-> query_vars['author_name'] = $user->user_nicename;1520 $posts_query->set( 'author_name', $user->user_nicename ); 1521 1521 1522 1522 // Set the displayed user global to this user … … 1559 1559 remove_action( 'pre_post_update', 'wp_save_post_revision' ); 1560 1560 1561 // Check forum status and exclude single forums the user cannot see 1562 } elseif ( bbp_get_forum_post_type() == $posts_query->get( 'post_type' ) ) { 1563 1564 // Define local variable 1565 $status = array(); 1566 1567 // All users can see published forums 1568 $status[] = 'publish'; 1569 1570 // Add 'private' if user is capable 1571 if ( current_user_can( 'read_private_forums' ) ) 1572 $status[] = 'private'; 1573 1574 // Add 'hidden' if user is capable 1575 if ( current_user_can( 'read_hidden_forums' ) ) 1576 $status[] = $bbp->hidden_status_id; 1577 1578 // Implode and add the statuses 1579 $posts_query->set( 'post_status', implode( ',', $status ) ); 1580 1561 1581 // Topic tag page 1562 1582 } elseif ( bbp_is_topic_tag() ) { 1563 $posts_query-> query_vars['post_type'] = bbp_get_topic_post_type();1564 $posts_query-> query_vars['posts_per_page'] = get_option( '_bbp_topics_per_page', 15);1583 $posts_query->set( 'post_type', bbp_get_topic_post_type() ); 1584 $posts_query->set( 'posts_per_page', get_option( '_bbp_topics_per_page', 15 ) ); 1565 1585 } 1566 1586
Note: See TracChangeset
for help on using the changeset viewer.