Home › Forums › General Issues › get_terms, custom taxonomy & relationship › Reply To: get_terms, custom taxonomy & relationship
Hello John,
Thanks for the response, I think on balance it’s easier for me to query the options table directly:
$terms = $wpdb->get_results( "SELECT CAST(TRIM(TRAILING '_offer_pages' FROM (TRIM(LEADING 'offer_category_' FROM option_name))) AS INT) AS term_id
FROM ".$table_prefix."options WHERE option_name LIKE 'offer_category_%_offer_pages' AND option_value LIKE '%\"" . (int)$page_id . "\"%'");
Interested to hear feedback on this but this will give me the term id’s I need which I can then hook back in to the ACF and WordPress functions to pull out the related offers.
Many thanks
Andy
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.