Add custom argument to WP_Query and modify SQL where clause

Solved it. The filter posts_where takes the query object as a second parameter.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)