The function that’s in charge of saving posts on the database (wp_insert_post) requires at the minimum a title and content:
http://codex.wordpress.org/Function_Reference/wp_insert_post
Edit: I created a quick and dirty jquery solution. Input this in your functions file or in a plugin:
<?php
add_action('admin_head', 'post_title_check');
function post_title_check() {
?><script type="text/javascript">
jQuery(document).ready(function($) {
$('input[name="save"]').click(function() {
if($('input[name="post_title"]').val() ==='') {
alert("Please input a title");
return false;
}
});
});
</script>'
<?php
}
?>
Basically checks to see if the text field is empty. If it is, gives you a message and prevents you from continuing. If it has something in the field, it submits with no issue.
Related Posts:
- Change “Enter Title Here” help text on a custom post type
- How do I get a post (page or CPT) ID from a title or slug?
- Limit the word count in the post title
- Is there a way to override the tag specified in header.php?
- How to correctly get post type in a the_title filter
- How to hook into the CPT’s title placeholder?
- title_save_pre on post publish
- Set Custom Post Type title to the Post’s Date
- Change title in head on Archive page
- How To Set Custom Post Type Title Without Supports
- Customize users’ capabilities to change a custom post’s post status
- Custom Taxonomies Terms as Post Title for Custom Post Types upon Publishing
- How to programmatically create a connection with [Plugin: Posts 2 Posts] on cpt publish?
- Set post title from two meta fields
- How I check if the same post slug has not been used before publishing?
- Custom Post Type with Custom Title
- Setting a title on a Custom Post Type that doesn’t support titles
- Using a Custom Field instead of original title field but only for Custom Post Type
- Search Post Title Only [duplicate]
- dynamically update permalink and title with the values of custom fileds
- wp_publish_post breaks permalinks
- get_page_by_title() not returning anything [closed]
- Custom Post Types: Custom columns with Title submenu?
- What is the impact if i ignore title and content in my custom post types CPT?
- Registration and Custom Post Types – How to synchronize information?
- How to filter out post type meta?
- Updating post title using wp_update_post
- Using several custom fields as custom post title
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- How to use the Display Name as the post title in a custom post type?
- Add acf field in title (admin table)
- Trigger email send after custom post publish
- How can I run this code once so that my generated post title doesn’t keep changing on publish/update?
- Set a maxlength for the title input in a custom post type
- Changing wordpress publication date to ACF date and time picker date not working
- Custom post type suppress transition from future to publish
- Custom title set on quick edit
- “Submit for review” for updates on existing posts
- Custom Postype specific changes in admin panel
- Custom Meta Title for Custom Post Type
- How can I move (or create another) publish button?
- How to set the seo title tag on a page by page basis?
- Can’t publish custom post type – “You are not allowed to edit this post.”
- Add the post type to the title of the page
- Get only used meta_values
- detect when a custom post is cretaed for the first time
- Custom meta Title for custom post type archive from page
- Custom Meta Box Causing Error: “Are you sure you want to do this? Please try again.”
- Getting all ID’s matching a title in a custom post type
- Address as a content type post
- Sanitize title only if only custom post type
- Add the custom post term to the custom post title
- Auto Generate Post Title from 2 Custom Fields
- Publish box in CPT remove ‘edit’ link
- Limiting the Number of User Posts to Their Own Posts
- Update main post with same category when creating custom post to update the modified date
- how to display posts content on the custom css popup by clicking on each title on the sidebar?
- Want to add new label in new post
- Modify Publish Metabox location on CPT
- filter the title changed also the page titles
- ACF saving posts
- Error [Column ‘post_title’ cannot be null] when title is disabled for Custom post type
- How to disable Publish button on Edit post if post title exists
- Publish post and create additional posts with same content
- Disable Facebook Comments Automatically On CPT
- How can I get taxonomy terms and custom field values of a newly created post
- Set the Title of a Custom Post Type by code as Author’s Username
- WordPress Author Posts Review After Every Change In The Same WordPress Post
- Updating User Meta from Custom Post Field Upon Publish Not Working
- Register a title automatically with a relationship field
- Emailing Authors only when a CUSTOM POST TYPE post is published- not when edited later [duplicate]
- Custom post type split title, setup permalink accordingly
- Showing User’s Post Counts by Custom Post Type in the Admin’s User List?
- Confusion with adding meta capabilities to a role after registering a Custom Post Type with corresponding ‘capability_type’ parameter
- Display content from custom meta boxes in revisions
- Custom Post Type pagination – normal solutions aren’t helping
- Rewrite custom post & taxonomy to share same URL path
- delete custom post based on custom field date
- Disable All In One SEO Pack for some custom post types [closed]
- Settings page above CPT page in admin section
- How do I create filters for custom post types?
- Customize the Dashboard Menu Editor
- I am having Trouble to get list of Categories of Custom post Type
- Automatically create child custom post when creating a custom post
- How can I have different content for different countries?
- Create a comments template for custom post types
- Is it possible to add posts and images (auto resize) for custom post types with a script?
- Display custom posts for each category from its custom taxonomy
- Function to limit number of custom post types on homepage – TwentyTen
- Custom Post Type not working with Capabilities
- Add custom post type to query
- Show all post type posts in manage users posts column
- Setting Custom Post Type Parents/Hierarchies
- Modify category permalink to use post type slug
- search results to show individual ACF fields from inside custom posts
- Automatically / dynamically populating tags in custom post type
- Remove CPT Slug with 2 taxonomies and 1 post meta
- Roots: Custom Post Type 404 Not Found [duplicate]
- Nested loop called with shortcode duplicating the content above the main loop
- Pagination for event query