• The WHERE clause wasn’t “preg replacing” for me, so I simplified it.

    
    	public static function posts_where( $where ) {
    		global $wpdb, $wp;
    
    		if ( ! self::_is_active() ) {
    			return $where;
    		}
    
    		$where = str_replace("$wpdb->posts.post_title", "$wpdb->posts.post_title LIKE '%{$wp->query_vars['s']}%') OR ($wpdb->postmeta.meta_value", $where);
    
    		return $where;
    	}
    

    Others seem to have had this issue too. Hope it helps. Great little plugin.

    I’m amazed it’s not more popular.

  • The topic ‘WHERE clause fix’ is closed to new replies.