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]
- shortcode doesn’t work
- Template plugin for blog posts? [closed]
- Is there any good tutorial to write custom login, registration and password recovery forms? [closed]
- jQuery Plugin to use WordPress functions in AJAX request
- 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
- WP plugins for building a database?
- Custom form action to handle data inside a plugin
- Can I use a plugin for a singular page on my website?
- 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?
- Creating an online questionnaire form – by Importing the questions from a spreadsheet?
- Using a custom plugin to capture input data via Ajax and PHP
- WordPress WPforms customization
- Submit page limited in time to upload image
- how to access all user dashboard on fronted page [closed]
- Ajax fail and get 504 error
- How to fetch form data and show it to my page?
- plugin shortcode output
- Submit custom form from post content and execute in plugin
- Char limit on custom blog-post form? [closed]
- How to include this jQuery File in wordpress?
- Is there a way to embed a Google Docs form in a page without using plugins?
- easy steps to make front end form without plugin
- Form that generates an ID for the customer
- Submit Form data to another page via Ajax (WordPress Way)
- Editing a text file from plugin menu
- Submitting form in wordpress 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()
- WordPress Plugin Insert Html Code with Shortcode
- “uagb/section and uagb/columns block”
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- Creating a form and displaying entry data as a table
- Storing The Data Collected by Ninja Forms into Another (custom) Database [closed]
- add_meta_box creating default form field types
- Form Plugin for Api Requests which is used via Shortcode
- Echo out element to another page.
- Select Form Element Not Saving from Plugin Options
- insert an html tag using php plugin
- Using AJAX to run SQL statement and populate dropdown
- how to convert XML from URL to HTML
- Apply a Meta tag to one page only
- Redirect plugin after form submit or show errors
- Why is adoptStyles-css stylesheet link added to every page?
- How to make a slider hearder?
- How to save Setting pages data to the database?
- get wpforms ID value from ACF text field
- User loggedin as Subscriber form not sending
- How to create a form where you can select multiple recipients, based on a list of website users?
- WordPress search input in database, to edit information via form and update the database
- Overriding inline !important CSS with Javscript code snippet with media query
- WPForms Custom Redirect not working
- Include my files in a plugin? [duplicate]
- How do I insert a shape onto an image and then play an audio file upon mouse hover or mouse click on that shape in WordPress
- Set up new WordPress domain using unclear files
- how can I edit the HTML of yith ajax product filter
- How to echo a PHP Code After the Content
- WordPress custom blockquote with black background & white text?
- How to submit custom form data using ajax to HubSpot form?
- Page takes on two different formats
- How to prevent encoding plugin HTML output to entities?
- get/show Last ID
- How to remove a css class for any wordpress page
- Why is every single HTML tag being stripped out of liveblog entries?
- Form tries to download a file on submit
- How to markup wordpress site using Schema.org?
- Is there a function to search for a wildcard value when calling a shortcode?
- Create user assessment and use results in sql query
- Saving custom form fields
- Possible jquery / library conflict in plugin usage
- Adding a Filter to Sidbar Login Plugin to Change Login Button Lable
- Create plugin with form in post and submit it to specific form
- Link Forms on WordPress
- Capturing POST data
- is ther a plugin that will hide/show content for a scheduled period of time? [closed]
- Undefined variable _POST
- How to prevent page load on form submission
- How to develop an extension for a simple form post and post back? [closed]
- Plugin Beauty Contact Popup Form with while loop
- Is it possible to set different payment gateway on each Gravity Forms form? [closed]
- How to Allow Users to Select Recipients In a WordPress Comment section?
- A way to upload old html pages with all its assets via WordPress admin and to add a fixed menu on top of those (a la Wayback Machine)
- Limit entry to a WordPress page
- Tips on using a custom template with Ultimate Member
- Can’t save formdata in DB
- How to create different woocommerce single_product.php pages for each product? [closed]
- Display file contents within Plugin