I'm using the WordPress 'posts_where' filter (https://codex.wordpress.org/Plugin_API/Filter_Reference/posts_where) to alter my queries as below:
function filter_my_search($where=''){
global $wpdb;
if(isset($_GET['q'])) {
$where .= 'AND (((' . $wpdb->posts . '.post_title LIKE "%'.$_GET["q"].'%") OR (' . $wpdb->posts . '.post_content LIKE "%'.$_GET["q"].'%")))';
}
return $where;
}
add_filter('posts_where', 'filter_my_search');
So a query is being run, and I'm intercepting the where clause, and adding an extra condition. Would that code be susceptible to SQL injection?