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