Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // http://www.gravityhelp.com/forums/topic/post-tags-auto-populatecontent-template
- // change the 15 to your form ID
- add_action('gform_after_submission_15', 'add_name_as_tags', 10, 2);
- function add_name_as_tags($entry, $form) {
- // read the post ID from the entry and the first and last name from the $_POST
- // change 6_3 and 6_6 to your form field IDs, using underscores
- $post = array( 'ID' => $entry['post_id'], 'tags_input' => array(rgpost('input_6_3'), rgpost('input_6_6')));
- // update the post
- wp_update_post($post);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement