How to check a single number value against an array of meta_key values?

The solution was that I need to compare the literal value of $projectID, so that LIKE compares an exact string instead of just numbers. To make $projectID literal, it needs to be wrapped in quotes.

So, I changed this line:

'value' => $projectID,

to:

'value' => '"'.$projectID.'"',

Which solves the problem.

Leave a Comment