Skip Navigation

[Gelöst] Save value to custom taxonomy term when creating post with CRED form

This support ticket is created vor 5 Jahren, 5 Monaten. 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)

Dieses Thema enthält 1 Stimme und hat 0 Antworten.

>

Assistiert von: Shane.

Author
Artikel
#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!