fixing legacy behaviour so that the user_id query modifications still work
removing use of wpdb prepare where not necessary
merging remote