Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // http://www.gravityhelp.com/forums/topic/automatic-sign-up-page-generating-a-new-web-page-or-post#post-179371
- // the 10 (priority), 2 (arguments) is documented here http://codex.wordpress.org/Function_Reference/add_filter
- // change the 5 here to your form ID
- add_action('gform_after_submission_5', 'update_page_settings', 10, 2);
- function update_page_settings($entry, $form){
- // get the post
- $post = get_post($entry['post_id']);
- // create a page, not a post
- $post->post_type = 'page';
- // set the page template
- update_post_meta($post_id, '_wp_page_template', 'template-my-form.php');
- // update the post
- wp_update_post($post);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement