I have a this db query in a plugin:
$query = sprintf("SELECT * FROM %s WHERE title='$post->post_title' LIMIT 1;"
It’s returning null on
$post->post_title. It works fine if I put a fixed value there, and also works fine if I hard-code it into the template loop.
So I know the tag is being ignored in the plugin, I just can’t figure out why, or what a proper syntax would be. Any help is appreciated.
- The topic ‘Can’t get WP tag from a sql query for plugin’ is closed to new replies.