Hook function when taxonomy terms change

You can avoid infinite loop by removing the action before calling update post function. function maybe_disable_comment($post_id) { // do you check if the post has specific custom tax term. if ( ! has_term( ‘bar’, ‘YOUR_CUSTOM_TAX’, $post_id ) ) { return false; } // remove the filter that will create infinite loop. remove_action( ‘wp_insert_post’, ‘maybe_disable_comment’ ); … Read more

How to automatically compare date from custom post type with current date and change taxonomy based on a result?

This is pretty straight forward and easy to do with $wpdb and SQL statement the relationship between any post type (custom or not) and taxonomy term (custom or not ) are stored wp_term_relationships table which has object_id and term_id all you have to do is query the record that has the term_id for active1 term … Read more

Gravity Forms with Advanced Post Creation Add-On not updating ACF fields on custom taxonomy

To resolve the issue with Gravity Forms and the Advanced Post Creation Add-On not updating ACF fields on a custom taxonomy, you can try adding the following code snippet to your WordPress theme’s functions.php file: add_action( ‘gform_post_create_post’, ‘update_custom_taxonomy_acf_fields’, 10, 3 ); function update_custom_taxonomy_acf_fields( $post_id, $form, $entry ) { // Check if the custom taxonomy term … Read more