Add predefined/default values to custom post plugin
You can use default_content
filter which filter the default post content on add new post screen only.
Example:
function filter_function_name( $content, $post ) {
if ( 'movie_reviews' == get_post_type($post) && empty($content) ) {
$content = "This is some custom content I'm adding to the post editor because I hate re-typing it.";
}
return $content;
}
add_filter( 'default_content', 'filter_function_name', 10, 2 );
Related Posts:
- current post index within content.php
- Is there any way to get list of all possible filter hooks for all post types?
- Custom posttype content metabox
- post_content is stripping HTML when adding a new post? [closed]
- displaying content of custom post type
- How to filter url on post submission?
- How do i truncate content length to 500 words?
- Media is not showing on post page
- Post content is cleared when updating
- Store custom post type with JSON content
- How to remove custom post type archive
- How to use a custom post type archive as front page?
- How to make a WP_Query search with custom post types?
- Filtering a custom post type by custom taxonomy in archive template
- get term archive url / link
- How to get the custom post type from an archive page?
- DOING_AUTOSAVE function in wordpress
- The Operator “NOT IN” Does Not Work In tax_query
- How can I fix those issues generated by the Themecheck plugin
- Admin Post Update Redirection to Posts Screen
- Why is get_post_format() for “Standard” returns empty
- Password-protect a custom rss feed
- Custom Post type sort order not working in the admin area
- Page Templates – this code only works for one Custom Post Type
- How to Change the Title of a Meta Box on a Specified Custom Post Type? [duplicate]
- How to save the checked boxes?
- Custom Post Types – How to include custom fields
- Enabled Revisions to existing custom post type not working WordPress
- Disable dragging of metaboxes in custom post types?
- Adding new Post through Custom Post Type only offers me “Slug” as an option, how do I get more?
- Return Attachments from Custom Post Type
- How to get attached file in wordpress from custom post
- Bulk edit custom excerpt text in WordPress
- How to add new tab to admin list of posts and handle result list
- Archive Page Not Found on Custom Post Type
- Connecting a taxonomy with a post type
- Customising rewrite rules for CPT single post URL to work as paged URL
- How to achieve representation of streets index with custom taxonomies
- Search Custom Post Type Custom Fields
- Can’t create more than 5 custom post types
- How to filter custom taxonomy categories on archive?
- “add_post_type_support” with Custom Post Type & ACF
- Problem fields custom date, time, and checkbox
- Insert data on comment post
- Include only recents custom posts in WP rss feed
- Move custom post menu to under plugin admin menu
- Get posts by querying taxonomy and certain terms of the taxonomy?
- Create template for taxonomy results limited by Custom Post Type
- Trash / Draft a WordPress custom post after custom date field expires
- Posting to a Custom Post Type from front end – user generated content
- Show only one post on custom post type archive
- Filter custom post types by a field value
- Rewrites/query for multiple hierarchical custom post types
- Custom Post Type has_archive
- Display a custom posts page for post type
- Output terms for custom post types
- Edit the_content() function so to add a div wrapper
- Replace dynamically content in a custom database table when a custom post is created
- How can Custom Post Type and a page have the same slug?
- Custom Permalinks for Custom Post Types
- Prevent custom post type from showing up in custom menus
- Copy order items with metadata between orders – Woocommerce
- Default post_tag for custom post type
- Pagination for custom post types – url rewriting
- Add data to post edit page, when post is published
- Custom Post Type Specific Post Template
- Show specific content on parent custom post type and all children
- My template won’t apply, theme still fallback to index.php
- Thumbnails Not Generating
- One post auto attached to many another items
- How can I create new CustomPostType record using wp.api.collections?
- Custom endpoint filtering post by custom taxonomies
- Display custom post types by category
- Searching in multiple category + URL hierarchy in real estate WordPress site
- Custom post ID & display information related to this ID
- background featured image display using shortcode
- WP_Query – How To Query Only Custom Posts With No Children of Their Own?
- Wanting to list all Post types under a common category
- Can’t see post status drop down for custom post type
- Dynamically add a unique number/identifier at the end of post titles
- Order archive custom posts by taxonomy term [duplicate]
- Print post category name from a custom post type wordpress
- How to add pagination to a post loop in a custom BuddyPress tab
- Update 2 wordpress tables at once
- Problem displaying posts for a category in a custom taxonomy
- Create Inclusions and exclusions
- How to prevent post to repeat on my loop?
- WordPress custom post type queries
- Adding custom post types to the default loop, yet only posts that has terms from the core taxonomies
- Post_per_page -1 returns only half the results
- getting issue with custom advance fields plugin
- Cross post type parent page added parent page to permalink but give 404
- Categories and page filtering with pre_get_posts
- Why the custom post type links don’t work if not login?
- permalink structure for single-{post-type}.php in wordpress
- Why is Posts page selected when showing single Custom Post Type?
- register_post_type comment is not working
- Advise on Custom Taxonomies and Structure
- show the most recent date of all posts to display on front end
- How to add custom permalink struct with DYNAMIC author to a Custom Post Type