Changeset 13509 for sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-ratings-compat.php
- Timestamp:
- 04/12/2024 04:18:08 AM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-ratings-compat.php
r13489 r13509 45 45 } 46 46 $this->filter = $filter; 47 add_filter( 'posts_clauses', array( $this, 'add_filter_to_posts_clauses' ) );47 add_filter( 'posts_clauses', array( $this, 'add_filter_to_posts_clauses' ), 10, 2 ); 48 48 add_action( 'pre_get_posts', array( $this, 'no_found_rows' ) ); 49 49 add_filter( 'bbp_topic_pagination', array( $this, 'add_filter_topic_pagination' ) ); 50 50 51 51 // <meta robots="noindex,follow"> for filtered views. 52 add_filter( 'wp_ head', 'wp_no_robots' );52 add_filter( 'wp_robots', 'wp_robots_no_robots' ); 53 53 } 54 54 … … 94 94 * Allow ratings view to be filtered by star rating. 95 95 */ 96 public function add_filter_to_posts_clauses( $clauses ) {96 public function add_filter_to_posts_clauses( $clauses, $query ) { 97 97 global $wpdb; 98 98 99 if ( false !== strpos( $clauses['where'], ".post_type = 'wp_navigation' " ) ) { 99 // Only adjust topic queries. 100 if ( ! in_array( bbp_get_topic_post_type(), (array) $query->get( 'post_type' ) ) ) { 100 101 return $clauses; 101 102 }
Note: See TracChangeset
for help on using the changeset viewer.