WP get_terms and ACF field
WP get_terms and ACF field
WP get_terms and ACF field
Hiearchical terms structure and performance
The issue you are experiencing might be due to the action hook you’re using to save the term meta. The created_category hook fires after the term is created, but it doesn’t ensure that all fields are available at that point. To ensure that the term meta is being saved correctly even for the first category, … Read more
Set Variant options/attributes values on WooCommerce
Your code doesn’t show where $term_id is coming from. If it is not defined anywhere, then that could be causing the problem. Instead of using get_term() and get_term_meta() directly on your template file, you could define couple of helper functions to handle the data retrieval. This makes the template file a little cleaner and the … Read more
For anyone who stumbles across this, I finally found the answer in this previous post: How to modify the output of wp_terms_checklist when used within the built-in category metabox on edit posts? I wasn’t finding it because it’s the Walker class, not a hook.
Unable to import term_meta in wordpress using wp_cron
The issue I have is that if I use get_queried_object_id, the archive page for the parent term shows the shortcode for the parent term and the first child term. That’s not what’s happening. get_queried_object_id() will only return the ID of the current category. When you add [0] you’re just breaking the condition check meaning that … Read more
I am echoing the “procedures” term I expect to get this meta field get_term() returns a WP_Term object which by default does not include any metadata, even for registered meta keys. So registering a meta key does not automatically add it to the term object, but registering a meta key has 2 main benefits: You … Read more
I found the solution, all credit goes to @gmazzap, who gave this great answer in this post: How do I save each option in a multiple select menu as it’s own meta_key + meta_value pair? add_action( ‘created_house_feature’, ‘save_house_feature_meta’, 10, 2 ); function save_house_feature_meta( $term_id, $tt_id ) { $old_feature_group = get_term_meta( $term->term_id, ‘feature-group, true’ ); $new_feature_groups … Read more