Ever since the solution mentioned here, WP has been updated and now allows you to manipulate the save process of wp_insert_post
. If you look at the lines 3035 to 3057 (WP 4.7) the result of the check for empty title and content is stored in $maybe_empty
. This variable is then run through a filter called wp_insert_post_empty_content
. If that filter returns something that evaluates to ‘true’ the save process is halted. So you could have it return false to overrule the check for emptiness:
add_filter ('wp_insert_post_empty_content', function() { return false; });
Update. Note that post information is passed to the filter as well, so you can write a more sophisticated filter, for instance checking for the post type before deciding to return true or false, or impose a maximum length on the title, and so on.
Related Posts:
- Action hook ‘wp’ firing twice… why?
- Count singular post views automatically
- Custom function for “Submit for Review” hook
- How can I hook into creating a new post and execute wp_die(), before the post is inserted into the database?
- How can i do something after head like adding a hook for after head but before post
- Adding buttons to Add New Post and Add New Page
- How to access $post from a callback function
- Copy post to separate database with “add_action(….)”
- Call Web Services on post first publish
- Divs appearing everywhere in post content
- Automatically set post_parent value
- Is there a way to know when a page has been updated and do some action only once?
- Is update_post_meta used when save_post action hook is invoked?
- Count singular post views automatically
- Grab meta data before post is saved
- Which hooks are essential for post templates?
- Modify upload directory to use post category slug in file path on multisite installation
- Set static page/post from another blog on same network
- Disable sticky option for specific categories
- Highlight static blog page link in header
- Hooking into the post editing screen for an existing page only
- How to create a template for Pages?
- Trying to alter the post_content through the_post
- How do I do a page break?
- How to check if single.php has already called the_post_thumbnail function
- How to dynamically parse and transform post/page content before displaying it?
- Block editors annoying warnings
- Adding bootstrap classes to video shortcodes
- How to add a class to edit_post_link?
- Admin – no Featured image choice in create new/page|post
- Is there a way to create a meta box that can be added multiple times to a post dynamically?
- preg_replace not removed “class”
- why the same code got different results when using query_posts in functions.php and index.php
- Modify posts listing at back end
- Prevent posts with certain post_meta to be edited
- How to catch wordpress post ID when it’s published
- How to check in functions.php if there is data in a WP_Query?
- how to hide empty fields of post category description?
- Hook for changing excerpt content when excerpt not set
- Is it possible to add a shortcode below post title?
- Update post meta within save_post action
- Give posts a particular template based on the assigned category
- Display Featured Posts Grid on Static Page (Gazette)
- how to handle the loop using filling bootstrap grid structure?
- Exists filter or action that change Add New Post link?
- What hook can I use to modify custom post data before it is displayed on the page?
- Add content after get_header
- Cant’ Grab WordPress Built-in Posts Through Loop
- Change default post style to columns
- How do I allow certain users to make a certain type of post?
- How to add a post class on every post. (on homepage)
- I can’t find the relevant part of the loop in my theme file. How do I find the full content with “More…”
- WordPress Architecture as a CMS – Posts & Pages
- Am getting duplicate data from get_posts()
- Actions to use when flushing cache (when posts are added / deleted / modified)
- Change modified date to current date when title updated automatically
- Add a field in my rest api
- Permanently deleted posts still exist
- created post displaying differently on front end
- Posting to WP via URL
- Aligning images in the wp editor not working. How do i get this to work in custom theme?
- Restricting displayed posts to posts from only select authors
- How can I change the date format of the revision list?
- Run a function when a custom post is update?
- How to pull latest posts from a specific category
- the wp_post_update isn’t working all the time
- Hook when post is set from published to draft?
- Send email to user when I publish a new post
- Problem paginating a subquery on a post
- Get Category in save_post Hook
- How to prevent post update using transition_post_status
- Moved a website and excerpts don’t work for old posts
- How to prevent clicking on posts
- How to get value of a selected option from select tag and use it in WP_query to filter posts?
- How can i take all ids from untrash_post action?
- Integrate video and iframe in a post type gallery
- call a function when insert and update a custom post type
- How to put the WordPress blog into theme
- Display post order ranking within wordpress loop
- Displaying a specific sub-category’s posts from wp_query
- Trim excerpt to first paragraph
- Posts only showing on /localhost/wordpress/ and not on other pages
- Can’t get post_updated hook to work
- Is it possible to completely replace a post with an action/filter?
- How to get the postID inside ‘content_save_pre’? Other hook?
- wp query custom orderby not custom field
- Post are not showing up
- Hook To Get All Posts Deleted
- How to remove related post from home page
- Blog styling in SASS
- How to show the posts list into a static page? Problems to use the loop into a static page
- WP Load post with ajax and apply isotope
- Checking if some condition is matched before inserting post into database
- fire action when post is being edited as well as saved?
- Display the current post author and his url in the post header
- wordpress taxonomy results
- Get most recent posts by category that aren’t first overall [duplicate]
- The post order is different for logged-in and non-logged-in users? [closed]
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- save_post not working