Last active
April 11, 2017 06:23
-
-
Save kevinwhoffman/806886c0686aa8b0c88687795e0241c5 to your computer and use it in GitHub Desktop.
Set term on save post
This file contains 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 | |
function prefix_set_client_id( $post_id, $post, $update ) { | |
$client_id_term = get_the_title( $post_id ); | |
wp_set_object_terms( $post_id, $client_id_term, 'client_id' ); | |
} | |
add_action( 'save_post_clients', 'prefix_set_client_id', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment