Skip Navigation

[Fermé] Save value to custom taxonomy term when creating post with CRED form

This topic contains 0 réponses, has 1 voix.

Last updated by davidS-53 Il y a 2 années et 3 mois.

Assigned support staff: Shane.

Auteur
Publications
#1258217

I have a custom taxonomy called location. When adding a new location term, I need to save a value to a taxonomy field called "term-creator-id". I've found the create_category hook and written this up roughly:

function sf_save_term_creator_id( $term_id, $taxonomy_term_id ) {
	$term_creator_id = '30';
	update_term_meta( $taxonomy_term_id, 'wpcf-term-creator-id', $term_creator_id );
}
add_action( 'create_category', 'sf_save_term_creator_id', 10, 2 );

However it doesn't seem to do what's needed.

Is there a separate hook I should be using? I couldn't find anything in the docs- could you possibly point me in the right direction please? Cheers!

Le sujet ‘[Fermé] Save value to custom taxonomy term when creating post with CRED form’ est fermé à de nouvelles réponses.