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