Skip Navigation

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

This support ticket is created Il y a 4 années et 10 mois. There's a good chance that you are reading advice that it now obsolete.
Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

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

Last updated by davidS-53 Il y a 4 années et 10 mois.

Assisted by: 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!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.