Changeset 4838 for trunk/includes/common/functions.php
- Timestamp:
- 04/10/2013 04:18:43 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/common/functions.php
r4832 r4838 1492 1492 // Forum/Topic/Reply Feed 1493 1493 if ( isset( $query_vars['post_type'] ) ) { 1494 1495 // Supported select query vars 1496 $select_query_vars = array( 1497 'p' => false, 1498 'name' => false, 1499 $query_vars['post_type'] => false 1500 ); 1501 1502 // Setup matched variables to select 1503 foreach ( $query_vars as $key => $value ) { 1504 if ( isset( $select_query_vars[$key] ) ) { 1505 $select_query_vars[$key] = $value; 1506 } 1507 } 1508 1509 // Remove any empties 1510 $select_query_vars = array_filter( $select_query_vars ); 1494 1511 1495 1512 // What bbPress post type are we looking for feeds on? … … 1503 1520 1504 1521 // Single forum 1505 if ( isset( $query_vars[bbp_get_forum_post_type()]) ) {1522 if ( !empty( $select_query_vars ) ) { 1506 1523 1507 1524 // Load up our own query 1508 query_posts( array (1525 query_posts( array_merge( array( 1509 1526 'post_type' => bbp_get_forum_post_type(), 1510 'name' => $query_vars[bbp_get_forum_post_type()],1511 1527 'feed' => true 1512 ) );1528 ), $select_query_vars ) ); 1513 1529 1514 1530 // Restrict to specific forum ID … … 1530 1546 'post_type' => bbp_get_reply_post_type(), 1531 1547 'post_parent' => 'any', 1532 'post_status' => join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id()) ),1548 'post_status' => array( bbp_get_public_status_id(), bbp_get_closed_status_id() ), 1533 1549 'posts_per_page' => bbp_get_replies_per_rss_page(), 1534 1550 'order' => 'DESC', … … 1548 1564 'post_type' => bbp_get_topic_post_type(), 1549 1565 'post_parent' => bbp_get_forum_id(), 1550 'post_status' => join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id()) ),1566 'post_status' => array( bbp_get_public_status_id(), bbp_get_closed_status_id() ), 1551 1567 'posts_per_page' => bbp_get_topics_per_rss_page(), 1552 1568 'order' => 'DESC' … … 1560 1576 1561 1577 // Exclude private/hidden forums if not looking at single 1562 if ( empty( $ query_vars['forum']) )1578 if ( empty( $select_query_vars ) ) 1563 1579 $meta_query = array( bbp_exclude_forum_ids( 'meta_query' ) ); 1564 1580 … … 1569 1585 'post_type' => array( bbp_get_reply_post_type(), bbp_get_topic_post_type() ), 1570 1586 'post_parent' => 'any', 1571 'post_status' => join( ',', array( bbp_get_public_status_id(), bbp_get_closed_status_id()) ),1587 'post_status' => array( bbp_get_public_status_id(), bbp_get_closed_status_id() ), 1572 1588 'posts_per_page' => bbp_get_replies_per_rss_page(), 1573 1589 'order' => 'DESC', … … 1585 1601 1586 1602 // Single topic 1587 if ( isset( $query_vars[bbp_get_topic_post_type()]) ) {1603 if ( !empty( $select_query_vars ) ) { 1588 1604 1589 1605 // Load up our own query 1590 query_posts( array (1606 query_posts( array_merge( array( 1591 1607 'post_type' => bbp_get_topic_post_type(), 1592 'name' => $query_vars[bbp_get_topic_post_type()],1593 1608 'feed' => true 1594 ) );1609 ), $select_query_vars ) ); 1595 1610 1596 1611 // Output the feed … … 1626 1641 1627 1642 // All replies 1628 if ( !isset( $query_vars[bbp_get_reply_post_type()]) ) {1643 if ( empty( $select_query_vars ) ) { 1629 1644 bbp_display_replies_feed_rss2( $the_query ); 1630 1645 }
Note: See TracChangeset
for help on using the changeset viewer.