Advertisement
chrishajer

Set post format to user selection

Mar 24th, 2013
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2. // http://www.gravityhelp.com/forums/topic/set-a-post-format#post-179861
  3. // change the number 11 here to your post ID
  4. add_action('gform_after_submission_11', 'gf_set_post_format', 10, 2);
  5. function gf_set_post_format($entry, $form){
  6.  
  7.     // get post ID
  8.     $postID = $entry['post_id'];
  9.  
  10.     // get the submitted post format
  11.     // update this number to the field where your post format is submitted
  12.     $format = $entry['3'];
  13.  
  14.     // set post format
  15.     set_post_format($postID, $format);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement