Pleasing the plugin checker
-
Hi.
I am developing a plugin. Not sure if this is the correct place to ask, if not, please point me in the correct direction.
When developing I use the Plugin Check (PCP), which is giving me this error:
Incorrect number of replacements passed to $wpdb->prepare(). Found 3 replacement parameters, expected 4.
In this code:$query = $wpdb->prepare(
"SELECT c.*, u.user_email,
(SELECT meta_value FROM %1\$s WHERE user_id = u.ID AND meta_key = 'first_name') AS first_name,
(SELECT meta_value FROM %1\$s WHERE user_id = u.ID AND meta_key = 'last_name') AS last_name
FROM %2\$s AS c
INNER JOIN %3\$s AS u ON c.user_id = u.ID
$where_clause
ORDER BY c.date_added DESC",
$usermeta_table,
$table_name,
$users_table
);
So, I tried all kind of different solutions, could it be that the checker wants $where_clause to be represented by a placeholder?I have tried that but then I get this error: Incorrect number of replacements passed to $wpdb->prepare(). Found 4 replacement parameters, expected 5.
I also tried using %s but then I get some database error..
- You must be logged in to reply to this topic.