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
- How to fix ‘Notice: Undefined index:’ in PHP form action
- Return HTML Template Page with PHP Function
- Pass a PHP variable to another file
- Genesis – Customize search form
- ob_get_clean returns empty string, ob_get_flush outputs string
- Counting number of posts in a category and its sub categories and displaying result using shortcode
- Shortcode created to check language not works
- On update to 3.04 site started recording accents as “á” and “á”, what to do?
- How do I hardcode a WordPress shortcode into my theme?
- How to return multiples lines in a shortcode?
- How can I default to all WordPress roles when parameter is not included in shortcode?
- Implement a multi-value input field where the number of entries is not limited
- PHP contact form returns warning in text widget [closed]
- Listing and displaying WooCommerce Shipping Zones in the frontend? [closed]
- Recent post display using shortcode
- How do I turn a shortcode into PHP code?
- Need to turn this php into WP shortcode
- How to return a foreach inside a shortcode
- Shortcode content output but not in correct place
- Pass PHP variable to JavaScript without inline JS
- Count the number of times the search form template gets included on a page
- PHP code inside shortcodes
- woocommerce registration form with klaviyo(don’t work with current user)
- How to put a variable in a instance in the widget
- Custom Form Processing Issue
- WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
- Pass php dynamic variable to shortcode
- Input data from email form not going to JSON file
- do_shortcode with custom field
- Remove echo from shortcode
- Search Query: how to construct a search string from two select elements?
- Databases – Submitting data from inputs to database [closed]
- Shortcode to show the code
- db converts decimal number wrong
- Multiple do_shortcode in page template
- Ajax contact form return 0
- Shortcode from a function not working
- Is it possible to return content, and then also continue to do other things?
- $wpdb returns duplicate posts
- Catchable fatal error: Object of class stdClass could not be converted to string
- Shortcode to find and replace URL
- javascript variable to wordpress php variable
- Shortcodes showing in excerpt despite using strip_shortcodes
- form built dynamically with php, not submitting
- Search only working on front page (index) , not working on other pages
- Adding attribute to the post.php form tag in wp-admin
- How to make blog post entries appear as input form instead of just text?
- How to get my [shortcode] rendered on the home page, other pages are fine
- Front end file upload returning wrong attachment url
- What is the difference between Null vs Empty (Zero Length) string?
- MySQL Query Returns Array () In Shortcode
- How to work Woocommerce pagination inside shortcode?
- How to get woocommerce orders with get_posts method in a shortcode
- Counting number of posts in multiple (sub)categories using shortcode
- How to send a php var to jQuery Ajax call with two different file
- How to pass parameters in wordpress shortcode?
- Best way to use variables in multiple functions?
- Display a custom name when the user has no name settle in his account
- Echo short code syntax
- Store user form submitted information in post type
- How to return html as a string from php for WordPress
- Changing Date Format on Custom Meta Data w/shortcode call
- Javascript / PHP – closing the loop
- Add the shortcodes from the enfold theme to the other theme
- How to output values from a loop into a javascript array
- Updating the database after parsing CSV document
- Offset with ajax load more posts duplicates
- Creating wordpress user registration form
- How can i iterate through this shortcode array?
- Shortcode in a $output statement
- Need help with PHP functions
- When using shortcode, content stops generating after the_content
- Passing link parameter values to form
- Processing forms with php to wordpress database
- PHP Shortcode – 500 error
- Run PHP Results inside WP Shortcode
- Styling admin page rows in order of importance (checkboxes)
- On selecting shortcode generate selected shortcode table inside page editor worrdpress
- Difference in Get Variable Location
- Force string into signup form
- Data inserted in database, but ajax calls error function
- upload images on front by user using form
- My title is showing after the shortcode
- Shortcode to include PHP file, pass various parameters to include?
- Import and use a variable in additional settings of Contact Form 7 [closed]
- WP query with variables gives no result for specific user
- Is there a better way to output HTML as a shortcode?
- Field validation strlen works in php7.4 fails 8.1 [closed]
- Embed PHP script into WP – what is the best way
- Preventing script injections in HTML form
- Can’t insert into a database wordpress