Alway send submissions to the page the form is displayed. In your shortcode callback you can then display proper error or success messages.
Sample:
add_shortcode( 'classifiedsform', 'classifiedsform_callback' );
function classifiedsform_callback()
{
if ( 'POST' !== $_SERVER['REQUEST_METHOD']
or ! isset ( $_POST['classifieds'] )
)
{
return classifieds_input_form();
}
// process input show errors or success message
}
function classifieds_input_form()
{
// return a string with the form HTML
}
Make sure you don’t use a reserved variable or WordPress will drop the content silently.
Related Posts:
- Form action/link to render a plugin in WordPress front-end
- Get post ID from wp_insert_post()
- Display custom post type with shortcode
- WordPress Custom Shortcode Conflicting with Media Library
- How to save contact form 7 data in Custom Post Types (CPT) [closed]
- Reason action hook won’t work with update_post_meta from frontend form? Alternative?
- How can I fix a slow redirect after form submit from frontend (no plugin)?
- How to embed form data within the ‘Add new post’
- How can i list custom post type categories?
- Linking three taxonomies with ACF
- Post the content of a specific “Custom Post Type” post within a post using a shortcode
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- Generate Shortcodes by Taxonomy
- How would I create a shortcode to display a custom post within a page or regular post?
- WordPress posts with multiple fields
- WP_Query is printing out only one post when posts_per_page is set to multiple
- How to Submit Post Via cURL & PHP
- Shortcode insertion in tab
- Send email button in custom post type backend
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- Shortcode for display posts in wp-editor
- Display Recently Added Custom Post Types with Custom Taxonomy Shortcode
- Display users uploaded files as posts
- How to render a custom post type template with custom fields using shortcode
- Display Child Pages of Custom Post Type Parent Page
- Shortcode to display Staff post type based on Location post type and Specialty post type
- A form that can save/edit after first input
- wp_reset_postdata() and wp_reset_query() inside shortcode are not working to reset original page query
- Next Post links not working in custom post type shortcode
- Foreach inside shortcode not working as planned
- Edit Custom Post Type on Custom Admin Page instead Post Admin
- Using POST method in meta box, no results
- Form action doesn’t work if slug isn’t same as custom post title
- 404 Error on form submission within custom post type
- Shortcode leaves no space for other elements?
- Custom shortcode works in Elementor editor but not on frontend
- Custom post type Shortcodes wordpress
- how to create custom post type with dynamic category_name using shortcode
- Add shortcode inside of the_content()
- WordPress Custom Post Type and Shortcode for Portfolio Items
- Run shortcode in custom script in wp_head if post type is CPT ‘Jobs’
- Creating shortcode id for custom post types
- Shortcode is displaying the content on top of the page [duplicate]
- posts within custom post type all share the same content in the front-end
- Shortcode to return single custom post based on post taxonomy
- Change post type depending on shortcode
- Custom Post Type for Shortcode Use – Prevent it display as a post (with slug)
- Direct form to a custom page template
- How to call a post’s metadata in shortcode.php?
- Looking to Customize YouTube Video Embeds
- How to selected value default in option list?
- How to display class name in this shortcode post query
- Making a form for user to add new custom post with custom taxonomies and custom fields
- Why is my custom post query shortcode only showing 1 post?
- display custom portfolio tags
- How do I output a list of a specific post type in a table?
- Shortcode in pages or tempate files for custom post type
- Get Posts List of Current Selected Custom Taxonomy in Shortcode
- php dynamic content inside shortcode
- Show in an entry a Custom Post Type associated to a post
- How to upload two input files [closed]
- Change dynamically the dropdown list value
- Create a CPT to edit Shortcodes Atts
- Custom post type shortcode
- How to submit the date with ajax?
- How can I use javascript in specific posts without relying on a plugin?
- Attend event form with ajax
- Why can’t I filter my CPT shortcode by category?
- From CPT Custom Loop into Shortcode?
- editing shortcode for custom post type within a plugin
- Custom Post type shortcodes
- Custom post type shortcode with taxonomy attribute not working and no errors
- Display Custom Post Type Archive content with Shortcode
- Load custom post type with ID in a shortcode
- How to seperate posts by categories?
- Display a list of sub-pages of Custom Post Type Parent Page
- Shortcode in excerpt
- custom search form for custom post
- Getting Custom post category from Form
- Submitting custom post from frontend,jQuery ajax, and custom validation – can’t find proper place to insert wp_insert_post()
- Shortcode error
- Front end page submission form does not attach custom post type
- Custom Post Type vs Shortcode: Which one is more performant?
- Front-end form submission not creating post
- How to call Shortcode categories for custom post types?
- Forms with multiple element types using custom post types
- Displaying database table in backend of wordpress
- adding a shortcode into a custom post type
- Nested loop called with shortcode duplicating the content above the main loop
- Add number in increment of one to DIV ID
- Create shortcode for list of custom post titles with custom fields alongside
- Creating shortcodes with user created forms
- Adding custom shortcode to page leads to page without styling
- custom post types shortode stays on top of other page contents. Is there a bug?
- Shortcode in a page to display custom posts which also have a shortcode in them
- Passing postid of Testimonial Custom Post in Shortcode Parameter
- Display page and custom post title inside shortcode
- From form submission values – dynamically update CPT “has_archive” slug and custom taxonomy “rewrite” slug value
- trying to display custom post type with custom taxonomy value by shortcode can’t works [closed]
- select categories by ids/display terms only selected