Custom Shortcodes, Includes, and Return.
-
I was previously using tags to embed videos, and simple conditionals. Users had to fill out a form, which embedded a cookie, and then the videos become available. If the embed-video tag was present, the forms were included. If the cookie was already present, the forms are skipped and the video is included. Now I’d like to upgrade to custom shortcode.
Here’s what I’ve got so far.
[Code moderated as per the Forum Rules. Please use the pastebin]
All of this code works. The issue is that while the video embeds at the proper location within the post, the forms show up at the top of the post no matter what.
This is because I use return to embed the video and include to embed the forms. There’s lots of conditionals and validation directly within the included forms, so as far as I know, I can’t wrap it all in a variable and return it.
Is there another way I can continue to use includes, but have the forms show up at the same spot as the video player?
I hope this makes at least partial sense. Any input is greatly appreciated.
- The topic ‘Custom Shortcodes, Includes, and Return.’ is closed to new replies.