Auto Featured Image for Gravity Forms Posts by Response

This scenario is fairly specific, Gravity Forms to post and adding a specific featured image based on a form field but the ease of assigning a featured image via the media post ID is hand elsewhere and it’s always nice to document more ways to tweak Gravity Forms. Step One Upload your images to the WP Media Library. After uploading the images you want to use, go to the Media Library and change the view to list view. If you mouse over the edit button, you’ll see a URL appear in the bottom right of your browser window. Setup Your Form Take note of the entry ID of the form element that’s going to determine the featured image. It’s likely the same number you’d get if you counted the fields from top to bottom but if you made them and rearranged them it could be something else. If you mouse over the field in the form editor, you’ll see the form ID in blue. The Code Now we’re just writing a bit of PHP to tie into the form. In this case I’m tying it just to form 5 with this action add_action( ‘gform_after_submission_5’, ‘altlab_timeline_featured_image’, 10, 2 );. Leaving off the _5 would apply it to all forms and changing the 5 to another number would target another form. In […] […]

Read More…

Backdating a Gravity Forms Created Post

This is something that’ll come in handy with forms creating timeline events. You can add a date field to the form and this will change the post date to match it. It might work the other way too, I didn’t try that. Take note of the notes below as this is setup for the date being field one of the form and for the form having ID 5. […]

Read More…

Privacy Statement