Skip to content

Instantly share code, notes, and snippets.

@kevinwhoffman
Last active April 11, 2017 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinwhoffman/806886c0686aa8b0c88687795e0241c5 to your computer and use it in GitHub Desktop.
Save kevinwhoffman/806886c0686aa8b0c88687795e0241c5 to your computer and use it in GitHub Desktop.
Set term on save post
<?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