Up to 50 percent off

Conditional logic and action hook?

This topic contains 5 reply and 2 voices, and was last updated by Dawn 10 years, 4 months ago
Viewing 5 Posts - 1 through 5 (of 5 total)
Author Posts
July 7, 2014 at 3:19 am 23076
Dawn I am currently using WPUF to run a submission form where people use a dropdown to select the post format. The post format dropdown was set up using the method described here: http://wordpress.org/support/topic/plugin-wp-user-frontend-set-post_format-when-adding-post?replies=3#post-3709483 It is shown on the form using an action hook. People can select from: Standard, Image Gallery, Video Player, Audio Player Currently, I also have spaces on the form for people to upload images (for the Image Gallery) and URLs for video and audio links. As is, all of these show up regardless of the post format they selected. It would be great if I could use the new conditional logic feature so that if the image upload only shows up when someone selects Image Gallery, video URL only shows when someone selects Video Player, etc. Any ideas on how I can accomplish this? Thanks!
July 7, 2014 at 9:04 am 23084
Dawn Dawn

Wait a second… Post formats are already set up as taxonomies in WordPress. Would it work to create a custom dropdown field with the values for the post format types?

If that’s possible, then I can use the conditional logic feature to show other fields depending on the post format type…

July 7, 2014 at 9:38 am 23086
Dawn Dawn

Gave above idea a try, but no luck. Selections in made in dropdown fields created through the form editor (instead of added with an action hook) aren’t saved.

July 7, 2014 at 3:46 pm 23106
Sekander Badsha Sekander Badsha

Are you trying to do something like this ? http://demo.wedevs.com/wpuf/conditional-test/

If yes and want to see how did this, login to our demo site (user,pass is demo) and see there is a form named conditional test. You’ll get the idea how I did it.

Let me know if you feel any difficulties.

July 7, 2014 at 7:30 pm 23130
Dawn Dawn

Thanks for setting up the test form, but it doesn’t do what I need. In your example, you simply created Categories named Image Gallery, etc., so the selection saves as the given Category – it needs to save the actual Post Format.

July 7, 2014 at 11:23 pm 23144
Dawn Dawn

I was finally able to get Post Formats and conditional logic to work using Radio fields instead of Dropdown for Post Format selection.

Viewing 5 Posts - 1 through 5 (of 5 total)