Ticket #2308: 2308.2.patch
File 2308.2.patch, 1.5 KB (added by , 12 years ago) |
---|
-
includes/common/functions.php
1532 1532 // Forum/Topic/Reply Feed 1533 1533 if ( isset( $query_vars['post_type'] ) ) { 1534 1534 1535 // Matched post type 1536 $post_type = false; 1537 1538 // Post types to check 1539 $post_types = array( 1540 bbp_get_forum_post_type(), 1541 bbp_get_topic_post_type(), 1542 bbp_get_reply_post_type() 1543 ); 1544 1545 // Cast query vars as array outside of foreach loop 1546 $qv_array = (array) $query_vars['post_type']; 1547 1548 // Check if this query is for a bbPress post type 1549 foreach ( $post_types as $bbp_pt ) { 1550 if ( in_array( $bbp_pt, $qv_array, true ) ) { 1551 $post_type = $bbp_pt; 1552 break; 1553 } 1554 } 1555 1556 // Looking at a bbPress post type 1557 if ( ! empty( $post_type ) ) { 1558 1535 1559 // Supported select query vars 1536 1560 $select_query_vars = array( 1537 'p'=> false,1538 'name'=> false,1539 $query_vars['post_type'] => false1561 'p' => false, 1562 'name' => false, 1563 $post_type => false, 1540 1564 ); 1541 1565 1542 1566 // Setup matched variables to select … … 1550 1574 $select_query_vars = array_filter( $select_query_vars ); 1551 1575 1552 1576 // What bbPress post type are we looking for feeds on? 1553 switch ( $query_vars['post_type']) {1577 switch ( $post_type ) { 1554 1578 1555 1579 // Forum 1556 1580 case bbp_get_forum_post_type() : … … 1686 1710 1687 1711 break; 1688 1712 } 1713 } 1689 1714 1690 1715 // Single Topic Vview 1691 1716 } elseif ( isset( $query_vars['bbp_view'] ) ) {