How to get Form ID Programatically
Author | Posts |
---|---|
September 11, 2013 at 10:53 pm 8033 | |
Tareq Hasan | Hello
I have a Guest Posting form in a custom page template and I call that form inside the template via php code:
<?php echo do_shortcode("[wpuf_form id=\"37\"]"); ?>
Thing is, this is multisite and people will create similar websites inside this multisite and they will have to create their own form.
How can I include this form inside the template in a way that it automatically grabs the ID of the form inside that php snippet? Any solution ideas please?
Thanks in advance!
Cheers |
September 12, 2013 at 5:58 am 8051 | |
Tareq Hasan | I am not sure what are you asking. Can you elaborate more please? |
September 12, 2013 at 8:25 pm 8085 | |
RockNRolla | Hello. Here is the scenario of my situation. I have a custom page template in my theme, called page-submit.php That is the template which renders the page where all the guests, non logged in and non registered users submit the posts (I have guest post enabled in WP Frontend User PRO plugin) To display the Guest Post form in this page-submit.php form, I use wordpress do_shortcode function: ` Form ID is 37. Everything works just fine. But, when I add another wp site (its a Multisite installation), I will have to create the same guest post form there too, and the Form ID will NOT be the same right? so, my page-submit.php template in that blog will not work, as it calls out pwuf_form id=37, which will be true only for the first main site, all other sites will have guest post forms with different IDs. I need to come up with the solution to somehow, display the guest post form in a way, that the form will display in all blogs, regardless of form ID or whatever. Any opinions? |
September 13, 2013 at 3:10 pm 8102 | |
Tareq Hasan | With a single form, it’s not possible to manage the whole network. Here’s what might be a workaround: |
September 13, 2013 at 11:04 pm 8115 | |
RockNRolla | Thanks for response. Can you clarify couple things please 1) Create a Master form << Master form? You mean a form on a main website of Multisite? 3) <> How can I do that? |
September 14, 2013 at 6:53 am 8130 | |
Tareq Hasan | 1) Just create a form anywhere and copy the custom field value. |