Advertisement
parkeast

Lesson Functions

Jul 4th, 2012
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.19 KB | None | 0 0
  1. <?php
  2.  
  3. // ********************* //
  4. // GRAVITY FORMS PLANS
  5. // ********************* //
  6. define( 'GF_EDIT_PLANS', 10 );  // define the ID number of your plans form.
  7.  
  8. /**
  9.  * Update the plan with information from the received profile GF.
  10.  * run last - just to make sure that everything is fine and dandy.
  11.  */
  12.  
  13.  
  14. function gf_edit_plans( $entry, $form ) {
  15.  
  16.     global $post;
  17.     global $wp_query;
  18.     $postID = $wp_query->post->ID;
  19.    
  20.         $monday_title = $_POST['20'];
  21.         $monday_content = $_POST['25'];
  22.         $monday_assignments = $_POST['36'];
  23.    
  24.         $tuesday_title = $_POST['20'];
  25.         $tuesday_content = $_POST['25'];
  26.         $tuesday_assignments = $_POST['36'];
  27.    
  28.         $wednesday_title = $_POST['20'];
  29.         $wednesday_content = $_POST['25'];
  30.         $wednesday_assignments = $_POST['36'];
  31.    
  32.         $thursday_title = $_POST['20'];
  33.         $thursday_content = $_POST['25'];
  34.         $thursday_assignments = $_POST['36'];
  35.    
  36.         $friday_title = $_POST['20'];
  37.         $friday_content = $_POST['25'];
  38.         $friday_assignments = $_POST['36'];
  39.    
  40.         update_post_meta($postID, 'monday_title', $monday_title );
  41.         update_post_meta($postID, 'monday_content', $monday_content );
  42.         update_post_meta($postID, 'monday_assignments', $monday_assignments );
  43.    
  44.         update_post_meta($postID, 'tuesday_title', $tuesday_title );
  45.         update_post_meta($postID, 'tuesday_content', $tuesday_content );
  46.         update_post_meta($postID, 'tuesday_assignments', $tuesday_assignments );
  47.    
  48.         update_post_meta($postID, 'wednesday_title', $wednesday_title );
  49.         update_post_meta($postID, 'wednesday_content', $wednesday_content );
  50.         update_post_meta($postID, 'wednesday_assignments', $wednesday_assignments );
  51.    
  52.         update_post_meta($postID, 'thursday_title', $thursday_title );
  53.         update_post_meta($postID, 'thursday_content', $thursday_content );
  54.         update_post_meta($postID, 'thursday_assignments', $thursday_assignments );
  55.    
  56.         update_post_meta($postID, 'friday_title', $friday_title );
  57.         update_post_meta($postID, 'friday_content', $friday_content );
  58.         update_post_meta($postID, 'friday_assignments', $friday_assignments );
  59. }
  60.  
  61. add_action( 'gform_after_submission_' . GF_EDIT_PLANS, 'gf_edit_plans', 10, 2 );
  62.  
  63. // ********************* //
  64. // END GRAVITY FORMS PLANS
  65. // ********************* //
  66.  
  67. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement