If I understand the code correctly, you are wanting to make the result_display()
function call conditional by moving the post check to inside the shortcode function. ie.
function display_shortcode() {
ob_start();
if (isset($_POST['submit'])) {result_display();}
else {html_form_code();}
return ob_get_clean();
}
Related Posts:
- How to trigger $_GET request within admin plugin page?
- Hook into and send mail using WP Mail SMTP type plugin from HTML static front page?
- How to insert HTML/JavaScript form into WordPress page? [closed]
- File Uploader – Upload without adding to Media Library
- General Term for this form Field
- Why is my form going to frontend on html form submission present on the php files inside my custom plugin?
- Contact form 7 select box different value-text than content-text in option [closed]
- dealing with large HTML output via plugin code
- How can I make my custom shortcode work in a Custom HTML Widget?
- Simple form that saves to database
- Output in XHTML or HTML 5 for plugins?
- Let readers suggest edits from the frontend
- Get selected values from checkboxes and radio buttons via Gravity Forms gform_after_submission hook [closed]
- Using tabs for wordpress plugin
- Where should my plugin POST to?
- How do I make my wordpress page more friendly for mobile viewers?
- Plugin development: how to create a form and get custom data?
- Editor not displaying dynamically after clicking on the button
- Multi step form, custom plugin
- shortcode doesn’t work
- Contact Form 7 plugin refreshing page on submit [closed]
- Template plugin for blog posts? [closed]
- How to edit plugin’s html? [closed]
- Plugin form unable to process
- Trying to add admin file upload form plugin
- How to disable autocomplete for inputs in contact form 7? [closed]
- WordPress Custom Application form
- When is it useful to use wp_verify_nonce
- Datepicker not supporting timepicker
- add function to saving change on Options Pages
- Is there any good tutorial to write custom login, registration and password recovery forms? [closed]
- How to add an attribute to the body tag with a plugin?
- Suspicious google tag manager
- WordPress plugin form not saving data
- Admin page: form with enctype=”multipart/form-data” does not transfer its data
- jQuery Plugin to use WordPress functions in AJAX request
- How to make a custom field as an editor in wordpress?
- How to add page using HTML, CSS and JS?
- Add form fields dynamically on button click
- I wrote my plugin. How to display the result of the plugin’s function to sidebar (widget?)?
- Retrieving a Value from a wp-database
- Custom CSS for plugin form
- Form doesn’t submit on second submit call
- How can I get WordPress to save comments in markdown format?
- WP plugins for building a database?
- Error shown for Trying to get property ‘roles’ of non-object in WordPress After Content for User Roles
- Custom form action to handle data inside a plugin
- Inserting HTML tag with ACF into shortcode
- Can I use a plugin for a singular page on my website?
- wp_create_nonce function doesn’t work inside a plugin?
- Form isn’t inserting data into database with ajax plugin
- New User Form – Custom Menu Page
- Image upload and other options in the same plugin settings form?
- How Do I Figure Out What File(s) to Edit from Looking at the Source Code [closed]
- When using Simple Fields plugin, how do I pull the information out of the database to display on a page?
- Anonymous Postings
- Creating an online questionnaire form – by Importing the questions from a spreadsheet?
- Can I use custom CSS and js plugin to put JavaScript in to validate my forms
- Using a custom plugin to capture input data via Ajax and PHP
- Creating custom HTML pages
- WooCommerce: Building a page with user input which is used to query order status and external API and return a result
- auto populate list of questions if user select a category xyz
- WordPress WPforms customization
- Contributive page where people logged in can write
- Contact Form 7 Get Image Function [closed]
- Submit page limited in time to upload image
- Adapt PHP form action for WordPress?
- how to access all user dashboard on fronted page [closed]
- How can i get the post’s full html source by its ID?
- Is there any way to use google input tool or any other language keyboard with WordPress [closed]
- Blog titles from WP blog on plain html site?
- Ajax fail and get 504 error
- Frontent user submit and view content [closed]
- Take input from form and pass it to function using a wp-plugin
- Checkbox conflict in my custom plugin admin page
- html generated by theme exist but doesnt appear in browser
- Trying to fix form resubmition with PRG (Getting error: Cannot modify header information – headers already sent by)
- How do I make a child theme I made POST through a 3rd party plugin?
- WP Plugins – Use includes to display page content
- WordPress putting “rn” in every line break?
- How to fetch form data and show it to my page?
- Plugin to create forms using HTML [closed]
- plugin shortcode output
- Submit custom form from post content and execute in plugin
- How to allow user to select User ID in Formidable Pro form? [closed]
- Char limit on custom blog-post form? [closed]
- How to include this jQuery File in wordpress?
- AJAX fileupload – TypeError: not a function ajaxSubmit()
- Is there a way to embed a Google Docs form in a page without using plugins?
- Detailed form plugin, with ability to export to excel etc. OR edit PDF live? [closed]
- easy steps to make front end form without plugin
- Form that generates an ID for the customer
- How to Loop Through all Posts and Count Attachments using Get Media Attachments
- Submit Form data to another page via Ajax (WordPress Way)
- Editing a text file from plugin menu
- Submitting form in wordpress plugin
- How can I exclude a dynamic URL to show a popup created using ‘WordPress Popup’ plugin
- Ajax Plugin Not Echoing Response
- Plugin that will output submitted form data for user? [closed]
- How to handle forms from sidebar widgets – Processing $_POST variables using get_field_name()