Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // ********************* //
- // GRAVITY FORMS PLANS
- // ********************* //
- define( 'GF_EDIT_PLANS', 10 ); // define the ID number of your plans form.
- /**
- * Update the plan with information from the received profile GF.
- * run last - just to make sure that everything is fine and dandy.
- */
- function gf_edit_plans( $entry, $form ) {
- global $post;
- global $wp_query;
- $postID = $wp_query->post->ID;
- $monday_title = $_POST['20'];
- $monday_content = $_POST['25'];
- $monday_assignments = $_POST['36'];
- $tuesday_title = $_POST['20'];
- $tuesday_content = $_POST['25'];
- $tuesday_assignments = $_POST['36'];
- $wednesday_title = $_POST['20'];
- $wednesday_content = $_POST['25'];
- $wednesday_assignments = $_POST['36'];
- $thursday_title = $_POST['20'];
- $thursday_content = $_POST['25'];
- $thursday_assignments = $_POST['36'];
- $friday_title = $_POST['20'];
- $friday_content = $_POST['25'];
- $friday_assignments = $_POST['36'];
- update_post_meta($postID, 'monday_title', $monday_title );
- update_post_meta($postID, 'monday_content', $monday_content );
- update_post_meta($postID, 'monday_assignments', $monday_assignments );
- update_post_meta($postID, 'tuesday_title', $tuesday_title );
- update_post_meta($postID, 'tuesday_content', $tuesday_content );
- update_post_meta($postID, 'tuesday_assignments', $tuesday_assignments );
- update_post_meta($postID, 'wednesday_title', $wednesday_title );
- update_post_meta($postID, 'wednesday_content', $wednesday_content );
- update_post_meta($postID, 'wednesday_assignments', $wednesday_assignments );
- update_post_meta($postID, 'thursday_title', $thursday_title );
- update_post_meta($postID, 'thursday_content', $thursday_content );
- update_post_meta($postID, 'thursday_assignments', $thursday_assignments );
- update_post_meta($postID, 'friday_title', $friday_title );
- update_post_meta($postID, 'friday_content', $friday_content );
- update_post_meta($postID, 'friday_assignments', $friday_assignments );
- }
- add_action( 'gform_after_submission_' . GF_EDIT_PLANS, 'gf_edit_plans', 10, 2 );
- // ********************* //
- // END GRAVITY FORMS PLANS
- // ********************* //
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement