Changeset 7292
- Timestamp:
- 04/16/2025 06:00:44 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.6/src/includes/replies/functions.php
r7255 r7292 2084 2084 } 2085 2085 2086 // Bail if no post_parent to replace2087 if ( ! is_numeric( $query->get( 'post_parent' ) ) ) {2088 return $where;2089 }2090 2091 // Bail if not a topic and reply query2092 if ( array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ) !== $query->get( 'post_type' ) ) {2093 return $where;2094 }2095 2096 2086 // Bail if including specific post ID's 2097 2087 if ( $query->get( 'post__in' ) ) { … … 2099 2089 } 2100 2090 2091 // Get post_parent from query (used to get the topic ID below) 2092 $post_parent = $query->get( 'post_parent' ); 2093 2094 // Bail if post_parent is default '' (uses is_numeric() because WordPress does internally) 2095 if ( ! is_numeric( $post_parent ) ) { 2096 return $where; 2097 } 2098 2099 // Get post_type from query, define array to diff against 2100 $queried_types = (array) $query->get( 'post_type' ); 2101 $post_types = array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ); 2102 2103 // Bail if query is not already for both topic and reply post types 2104 if ( array_diff( $post_types, $queried_types ) ) { 2105 return $where; 2106 } 2107 2101 2108 /** Proceed ***************************************************************/ 2102 2109 … … 2105 2112 2106 2113 // Get the topic ID from the post_parent, set in bbp_has_replies() 2107 $topic_id = bbp_get_topic_id( $ query->get( 'post_parent' ));2114 $topic_id = bbp_get_topic_id( $post_parent ); 2108 2115 2109 2116 // The texts to search for
Note: See TracChangeset
for help on using the changeset viewer.