Skip to content

Instantly share code, notes, and snippets.

@nayemDevs
Created June 6, 2016 05:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nayemDevs/af3a206d742cea1e3be9ba4c16fd5b97 to your computer and use it in GitHub Desktop.
Save nayemDevs/af3a206d742cea1e3be9ba4c16fd5b97 to your computer and use it in GitHub Desktop.
Now, after adding these code you have to add a hidden field into your form. You have to insert the meta key name "wpuf_hidden_cat" and the value will be your category ID.
add_action( 'wpuf_add_post_after_insert', function( $post_id ) {
wp_set_post_terms( $post_id, get_post_meta( $post_id, 'wpuf_hidden_cat', true ), 'your taxonomies name' );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment