The ID of the post if the post is successfully updated in the
database. Otherwise returns 0.
So just test again that.
if ( $post_id != 0 ) { // success!
write_here_show_success_messages();
}
Or you can use an action.
<?php
/** use action for success message **/
if ( $post_id != 0 ) { // success!
add_action('form_message', 'write_here_show_success_messages' );
}
?>
<div>
<?php do_action('form_message'); ?>
<form>
<!-- form contents -->
</form>
</div>
Related Posts:
- wordpress function to change post status [duplicate]
- bulk post_content update
- How to check if wp_update_post was successful
- List taxonomy terms for post as checkboxes
- wp_update_post function ignores HTML tags
- wp_update_post does not change post status from draft to publish, returns 1
- Suitable hook when creating, updating and deleting posts programmatically
- Remove action from plugin on other plugin
- WordPress Plugin Development In MVC Architecture, How?
- How to build an API as a plugin
- What happens when two plugins have the same 3rd party class included into them?
- add_rewrite_rule, plugin activation and plugin deactivation
- Update Multiple Post Meta for the Same Post In One call?
- Allowing Custom Capability to Manage Plugin Options
- wp_insert_user – how to send verification email before logging in
- Create custom column in post table in wordpress
- How to load a new template page according to a particular URL?
- The plugin generated x characters of unexpected output, $wpdb not defined
- Override the core function locate_template
- Admin page: form with enctype=”multipart/form-data” does not transfer its data
- Use oEmbed in List Items
- Trigger renewal order emails for WooCommerce subscriptions for testing
- How Can I Pass the Shortcode’s $atts Variable to the Plugin’s Javascript Function
- Set user ID at time of wp_create_user
- Reset WordPress website
- WordPress Ajax Callback
- Best method to upgrade multisite plugin’s numerous database table
- Activated plugin is stored as an object, rather than as a path
- Problem converting tags to categories while having large number of tags
- Overriding functions in wordpress plugins
- Color java code the way it is colored in eclipse [closed]
- What is generating my meta og:description?
- Certain actions failing when run through cron
- How do you allow users tag a photo
- Send Custom welcome email to specific user group
- install robots.txt to wordpress website admin
- Add content to footer – above wp_footer
- Automatically populate title field
- Will these plugins work with wp multisite?
- Sync User to cPanel webmail?
- Is it necessary to auto delete my WP plugin database tables when users deactivate/delete my plugin?
- get gravity form ID from backend/wordpress admin
- How to insert and call new data in wordpress website database through a plugin
- What exactly happens to function argument availability when using a filter?
- Repeated Output in Widget
- Where is this strange og:description coming from?
- Dokan Marketplace store link in single product page
- How retreive saved data from gravity forms in my template?
- Redirect Plugins.php to New Plugin Page
- Need to revert to an older version of wordpress
- Sharing functions between plugins
- How to add an extra, independent set of custom fields?
- Making the ‘add to cart’ button redirect to PayPal
- Is the bulk_action hook stable for use in 3.2.X?
- WordPress search shows protected content
- Change Dashboard URL from wp-admin to wp-admin/index.php
- How to customize maintenance mode notification in wordpress?
- Can’t load the the canges of field groups [duplicate]
- Disable recpacha for contact form 7 specific form
- What is com_jce
- How can we get this dynamically as this folder may not be by the same name always → wp-admin
- Cant create table on plugin activation
- Why is my shortcode not working?
- Import 2000 posts from one website to another
- Critical Error after Updraft Restoration
- wp_remote_post To external API multiple values with the same key
- How to add specific posts to specific pages in WordPress?
- added code to permalink (URL)
- Why is my custom taxonomy image not displaying?
- redirect to a custom page
- How to order blog posts by no. of likes?
- Set Content-Type header in do_parse_request filter
- Add section (add_settings_section) to a custom page (add_submenu_page) not working
- cURL do not mimic click
- What action or filter can I use to change all the html returned from server for a page?
- Wordress admin page is fetching error You do not have sufficient permissions to access this page.
- How to change text in a page by utilizing a custom user id?
- How can I make my plugin display custom post meta data on the front end?
- Which WordPress version to use for improved plugin compatibility? [closed]
- WP_Filesystem usage within a block of code
- Convert HTML5/CSS3 site to WordPress Theme (need a lot of plugins) or just use the API?
- Extending the “Add Media”-Dialog … how do I finally insert something to the Post?
- How can I retrieve data within my widget
- Incentive theme – Getting ’You do not have sufficient permissions’ while trying to install plugins
- How do I make the selected layout display for all MarketPress pages?
- What tool are available in the wordpress API for debugging a plugin?
- In my plugin when i call select page is blank
- include plugin folder directly in theme folder to load faster page n wp
- Including a PHP file via a function that is part of a plugin?
- Twitter List Tweets and Delicious Links as Posts
- Overriding FB Auto Connect plugin function displayed in footer
- Replace all media (images)
- How do i remove “Powered by WordPress” from AMP?
- Integrate Razorpay quick payments plugin with contact form7 plugin
- Trying to disable all notifications except for one on woocommerce checkout page with css [closed]
- How I can hide my wp folders from Inspect Element (Developer Tools)
- How to Find WordPress site has backdoor login Codes
- How to add custom html to the Media > Attachment Details modal?
- Unable to access WPadmin, website down
- ‘Active lotteries’ only custom query for woocommerce lottery plugin and elementor