In a plugin that I'm writing, I need to find out the terms of a post, so I'm using the add_filter posts_join to do
SELECT SQL_CALC_FOUND_ROWS wp2_posts. *
FROM wp2_posts
LEFT JOIN wp2_term_relationships ON ( wp2_posts.ID = wp2_term_relationships.object_id )
However, that doesn't achieve anything.
I realise that if I run the following in sql itself, it gives me the tables that I need. can someone advise what i'm doing wrong?
SELECT SQL_CALC_FOUND_ROWS *
FROM wp2_posts
LEFT JOIN wp2_term_relationships ON ( wp2_posts.ID = wp2_term_relationships.object_id )