I would suggest that you remove the php from the form and instead write out the relevant HTML in your shortcode code.
-
Loop through wp_dropdown_categories and create a dropdown
-
Loop through clocations and build your collection of checkboxes
-
Drop the wp_nonce_field and code up something simple yourself using a hidden field.
Essentially the code doesn’t change much, it just outputs to a string instead. Once your shortcode puts out pure HTML, it can be wrapped inside another.
Related Posts:
- Get value from shortcode to do something
- Create a WordPress shortcode using PHP [duplicate]
- Creating WordPress Shortcode with Variable
- What is the alternative code to if (isset ($_POST) && !empty ($_POST) to avoid warnings?
- WordPress shortcode returns the data before
- Shortcode to embed Edit Account form not working
- PHP multiple forms, same page, isset($_POST[]) not working?
- Shortcode not passing variable to included file
- Redirect loop upon installation of my plugin
- Automatically populating a date parameter within a shortcode
- How to modify a global variable in a function and use it on another function?
- How to pre populate a form field with a link of a current user’s author profile?
- Why Won’t My Inputs in a form with a Get method work together?
- Input data from email form not going to JSON file
- How to get the value of input hidden html from text editor to custom page template?
- How create a Shortcode with hover and complex options
- Remove from shortcode
- Displaying recent posts on static page with template-part via shortcode
- wordpress 4.4 self hosted video (html5) doesn’t show
- Show success or error messages in Ajax response to WordPress custom registration form
- do_shortcode with custom field
- Styling my own password protected page, how to deal with wrong password?
- Contact form won’t submit
- How to Reference/Echo Variable from Another PHP Function
- Remove echo from shortcode
- wp_mail file attachment not being placed in upload folder?
- Replace shortcode in substring
- Search Query: how to construct a search string from two select elements?
- Login to wordpress by clicking a link and specifying usernaname and password in url
- Databases – Submitting data from inputs to database [closed]
- How to show a ‘correct’ message after submit a form?
- Shortcode to show the code
- db converts decimal number wrong
- Form Security: nonce vs. jQuery
- Shortcode returns values in the wrong order
- WordPress admin-ajax.php 400 bad request
- Get URL from shortcode tag
- Embedding PHP in shortcode $content
- Shortcode with PHP issue “Undefined index”
- Excecuting php function in shortcode
- Only first shortcode gets executed
- Multiple do_shortcode in page template
- Ajax contact form return 0
- Variable not staying set
- Trying do build a contact form
- “operation successful” message
- Returning data instead of echoing/printing
- User register hook is not working in woocomerce register form
- echo something inside a shortcode
- Search WordPress using static html page
- displaying content that includes shortcodes within an echo
- List taxonomy term slugs within shortcode (do_shortcode)
- Shortcode from a function not working
- Display Data in Table from External Database in WP using Shortcodes
- get_posts works in the page template but not in a shortcode
- Is it possible to return content, and then also continue to do other things?
- ::before on open/close function [closed]
- anyway to put inside a $outprint=sprintf()
- Is There A Way To Make Theme Files Accept Shortcodes?
- How can I include shortcodes within PHP?
- How to execute html code inside php?
- WordPress function and string as variable?
- Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?
- How to pass a PHP $_GET variable and fetch/output it?
- do_action(), iFrame Gets Displayed Despite Password Protection [closed]
- $wpdb returns duplicate posts
- Catchable fatal error: Object of class stdClass could not be converted to string
- Syntax error in a shortcode function
- Using Shortcode to Grab Archive Listing, Separate by Year
- Capitalize Shortcode Value on Output
- Shortcode to find and replace URL
- Why is my str_replace not working on short code submitted by front-end?
- Could use some help with Shortcodes
- Apply class to every third list item? [duplicate]
- persist a variable set in header.php all the way down to footer.php
- Can a page contain php code?
- Unable to process php via shortcode
- Help with WordPress function inside a shortcode
- How to send form data from WordPress (Meta Box) to an OData service?
- Get access to variable from previous pageview, excluding ajax-calls
- calling a custom field value inside functions.php
- Using ob_start and ob_get_clean with wordpress shortcode
- How to deal with too many $_POST variable conditions from ajax request at backend? [closed]
- Short code template + ajax
- List all blogs, but exclude the main site
- How to pass a variable to get_template_part that’s updated every time the template part is called?
- Shortcode not staying inside div tag
- Line breaks inside shortcode variable
- Form Submission Not Working In Custom Theme
- Insert page content into another page with a changed variable
- Pass Variables or Variable Place-Holder from Editor to PHP
- How to access or parse key/values that have “string”
- Capture form data in one function and use it in another function (same file)
- Handling PHP/HTML inside the output of a shortcode function
- Shortcode for Listing Users from Meta Value?
- Cant display an image via PHP in wordpress
- Shortcode to pull posts
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- javascript variable to wordpress php variable