Last active
December 27, 2019 22:35
-
-
Save polevaultweb/c333c8d7925a0052883e3664b344ccff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'add_post_meta', function ( $object_id, $meta_key, $_meta_value ) { | |
| if ( $meta_key !== '_igp_id' ) { | |
| return; | |
| } | |
| $category_id = 11; // Change this to the tag_id | |
| wp_set_post_categories( $object_id, array( $category_id ) ); | |
| }, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment