function disable_save( $maybe_empty, $postarr ) {
$maybe_empty = true;
return $maybe_empty;
}
add_filter( 'wp_insert_post_empty_content', 'disable_save', 999999, 2 );
Because wp_insert_post_empty_content
is set to true, WordPress thinks there is no title and no content and stops updating the post.
EDIT: An even shorter variant would be:
add_filter( 'wp_insert_post_empty_content', '__return_true', PHP_INT_MAX -1, 2 );
Related Posts:
- WordPress as a web app – always auto-save post and meta data
- Disable a function from executing in post.php
- Add custom column to Users admin panel
- Modal window from within WordPress admin
- How do I remove dashboard access from specific user roles?
- Search posts by ID in admin
- Sort pages in loop by admin’s page attributes order field?
- Edit “thank you for creating with WordPress” in version 3.3.1
- How to save dismissable notice state in WP 4.2?
- Notification that the admin is online
- Plugin to remove Admin menu items based on user role?
- How to obtain the user ID of the current profile being edited in WP-Admin?
- Get current active wp color scheme
- Cannot login to WordPress Admin with SSL terminated load balancer
- use add_settings_field properly?
- Is there a hook to put stylesheet and/or JS inside iframes (thickbox or tinyMCE) in admin area
- Thickbox hacking – removing fields
- How to let authors revise other authors drafts, but keep them from publishing?
- Conditional check for front-end which includes ajax
- Hide update messages from non-admin users?
- Is there a way to prevent author change when editor/administrator edits a post?
- Better search for WordPress admin backend [closed]
- WordPress last login foreach user
- custom tabs in media uploader
- WordPress Left Hand Side Admin Menu Always Collapsed
- How to customize this automatic slug shortener with an overrwrite function
- Hide content-box on specific pages (in admin)?
- Moving a WordPress site to a new server
- Re-ordering Admin Submenu Sections
- How to Remove the “Restore” Link in Quick Edit?
- How to add_filter/action to comment out CSS generated by admin function?
- Remove default WordPress styling from metaboxes on edit post pages?
- Admin Notices coding standard issue
- What are WordPress admin supported browsers?
- how to redirect to url.com/wp-admin if url.com/admin is typed in?
- Restrict dashboard access for specific user roles to specific actions
- user-new.php less detailed after WP3.1; how to revert?
- How can I remove the “updates” menu in the WordPress Admin panel?
- Where does WordPress store a list of Super Admins?
- Get current logged in user under 3.1, re: remove “Howdy”
- How to restrict wp-admin and prevent upload errors
- How do I change Administrator to Super Administrator
- Manage users custom column add class “num”
- Remove Admin sidebar link
- Find Memory Usage of Admin
- How do you set up a WordPress blog with multiple authors to allow something like StackExchange’s “community wiki” feature?
- wp-login behind nginx reverse-proxy inaccessible — bad redirect?
- One button on admin page works but not two
- Can’t access dashboard as administrator, login as any other level works though
- How to display a WordPress notice on create_term action
- Display popup or admin-notice after add new categories
- CPT Validation to not show “Post updated.”
- WordPress post feature image not uploading
- Super administrator db name
- Dashicons and Pseudo :before
- Redirect in an Admin page
- Hide admin toolbar based on a query string
- Remove Permalink From Admin Edit Post
- When submitting the form site.com/blog/wp-admin it goes to site.com/wp-admin
- How can I POST or GET to the same admin page from which I am POST-ing or GET-ing
- WordPress admin toolbar not loading styles after migration
- Access for adding subpages but not for pages
- remove menus for a specific role?
- How can I add a menu item to the admin area?
- I’m a super admin and I want to give an admin the ability to add new users…?
- Return User Meta text as links to post edit inside the user columns
- Order All Pages table in administration
- WordPress Admin Menu Order for ‘admin.php’ pages
- Show global Message in User Profiles with admin only Input field in WordPress Backend
- How to make sure your admin doesn’t hi-jack you site?
- Admin bar is disabled in front
- Is there a filter to remove or replace the post title’s link in the admin post table view (edit.php)?
- How to pass a specific post id from “all posts” list in Admin panel
- How to change the link of the wordpress logo in the admin bar?
- How should I setup the “Users” area to hand over to a client?
- Shows site under construction but comes up after I login to admin
- Wp-Admin FTPS Connection Error unlike Filezilla
- Default scripts added to each admin page
- Settings API – Last two tabs not rendered separate
- Adding a WordPress Admin Dashboard to my local wordpress site
- cannot access the wordpress dashboard after changing the site url
- Reset WordPress admin users to limit access
- Is it possible to push admin notices to one specific user instead of all users?
- After upgrading to WP 5.1.1 sometimes I need to reauth infinitively
- Trying to hide a submenu link which is created by Co-authors Plus plugin
- Blank WordPress admin/dashboard (7 updates pending)
- How can I create multiple different admin roles with their own capabilities
- Find out if post was just updated on post edit screen
- Wp-admin page not found following copy of site
- Custom redirection when managing users in admin
- How to retain HTML5 Attributes on Markup
- Why doesn’t the Media Browser use thumbnail sized images?
- wordpress login loop after install
- Improving this link color picker code
- Change Admin URL
- Change the Author name to a custom field?
- How to remove certain feed from my dashboard in WP admin
- Hiding the media-new.php File URL option via jQuery
- Buddypress send admin notification email when new subscriber registers
- Background image in login showing in admin area