If you supply no title, WordPress will set the title to: (example)
(no title)
This will be shown in the list table for the post type in the admin area, within the database, the post_title
value will be empty.
As no title is supplied, WordPress will set the slug to: (example)
1234
…where 1234 is the ID of the object. The post_name
value in the database will receive the ID.
Of course if you are programmatically supplying a slug then you can set the slug to something more meaningful than the ID and this is where the save_post
hook comes in handy.
Important Note:
If you supply no content (value) for the post_content
field, then your post will be set to auto-draft
for the post_status
column.
So you might need to use the save_post
hook to set a default value for the post_content
field.
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
- Get Post ID by Content
- 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
- Custom Taxonomies Terms as Post Title for Custom Post Types upon Publishing
- 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
- Remove tinyMCE from admin and replace with textarea
- How do I create new content pages for my Custom Post Type?
- 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
- get_page_by_title() not returning anything [closed]
- Jetpack infinite scroll render – make different depending on post type?
- Custom Post Types: Custom columns with Title submenu?
- Posts created in a Custom Post Type are lost if published without a title
- How to filter out post type meta?
- Updating post title using wp_update_post
- WordPress theme options vs custom post types
- 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)
- How can I run this code once so that my generated post title doesn’t keep changing on publish/update?
- Best way to save horoscope data
- Set a maxlength for the title input in a custom post type
- Custom title set on quick edit
- How can you use one database with multisite
- Custom Postype specific changes in admin panel
- Custom Meta Title for Custom Post Type
- How to set the seo title tag on a page by page basis?
- Add the post type to the title of the page
- Custom meta Title for custom post type archive from page
- get parent content inside child posts
- 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
- Adding Template Post Content
- How should I structure complex content hierarchies?
- Add the custom post term to the custom post title
- WordPress general content best pratices
- Auto Generate Post Title from 2 Custom Fields
- php dynamic content inside shortcode
- 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
- filter the title changed also the page titles
- How might I change the destination of a link?
- 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
- How to use TOC with ACF?
- Expandable WordPress content (text) inside a post
- Set the Title of a Custom Post Type by code as Author’s Username
- Register a title automatically with a relationship field
- Custom post type split title, setup permalink accordingly
- post count is wrong when using same taxonomy for 2 different CPT
- Issues when rewrite rules collide?
- Show Custom Post Type by Author
- Newer/Older posts links display same posts on every page
- How to sort CPT by custom meta value (date), and return posts month by month
- Search results ordered by custom post types are not grouped
- When viewing single parent post, display list of children
- Featured image metabox not showing up
- Limit Authors to their Own Posts on front-end excluding admins
- How to redirect all pages of a custom post type [duplicate]
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Add information above a custom post type listing of all posts page
- Programmatically adding posts
- Get rewrite slug of custom post type in template
- How can I add another option to this custom post function?
- Restrict user to only one custom post type
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- Page template with different page and post content
- Custom post type url with category
- Remove slug in URL custom post type
- How to restrict author to only access one custom post type ?
- How to get a custom field value of a custom post?
- Multiple single templates?
- how to set a WP Plugin’s url
- Values from meta-box not on $_POST
- Display all images from specific CPT
- Can I automatically assign a page template to a custom post type (i.e page-slug.php file)
- Restrict Custom Post Type to One Item
- Custom URL for Custom Post Type & Custom Taxonomy Term
- Using pre_get_posts assign custom post to wordpress editor user
- Edit single page from plugin
- Manually build WP_Query
- Custom Post Type Causing Admin Sidebar UI Issue
- WordPress Custom Post Type and sort by Tags
- single-mySlug.php works: archive-mySlug.php does not. Custom Post Type
- No error in debug mode, wordpress template can not be loaded
- Taxonomy Archive URL + Template