09/25/2014 at 10:33 am
#305150
Keymaster
@ Michael
Dang! Yes that ad hoc caching I’m doing would cause a problem with getting the updated categories. It is really just a temp solution until I have the cnCache class completely fleshed out.
Until I sort this out, maybe you could just query the categories in your filter instead…
$sql = $wpdb->prepare( "SELECT t.*, tt.* FROM " . CN_TERMS_TABLE . " AS t INNER JOIN " . CN_TERM_TAXONOMY_TABLE . " AS tt ON t.term_id = tt.term_id INNER JOIN " . CN_TERM_RELATIONSHIP_TABLE . " AS tr ON tt.term_taxonomy_id = tr.term_taxonomy_id WHERE tt.taxonomy = 'category' AND tr.entry_id = %d ", $entry->getId() );
$categories = $wpdb->get_results( $sql );