I have already created a custom post plugin.
I need to add predefined text/values, when creating new custom post within this plugin.
Is it possible to handle these predefined text/values in my plugin .php file, and make them active?
<?php
/*
Plugin Name: Grand Prix Autíčka
Plugin URI: http://www/
Description: Přidávání autíček
Version: 1.0
Author: Thomas Dobo
Author URI: http://www/
License: GPLv2
*/
add_action( 'init', 'create_movie_review' );
function create_movie_review() {
register_post_type( 'movie_reviews',
array(
'labels' => array(
'name' => 'Grand Prix Autíčka',
'singular_name' => 'Movie Review',
'add_new' => 'Přidat Nový',
'add_new_item' => 'Add New Movie Review',
'edit' => 'Upravit',
'edit_item' => 'Edit Movie Review',
'new_item' => 'New Movie Review',
'view' => 'View',
'view_item' => 'View Movie Review',
'search_items' => 'Search Movie Reviews',
'not_found' => 'No Movie Reviews found',
'not_found_in_trash' =>
'No Movie Reviews found in Trash',
'parent' => 'Parent Movie Review'
),
'public' => true,
'menu_position' => 15,
'supports' =>
array( 'title', 'editor', 'comments',
'thumbnail', ),
'taxonomies' => array( '' ),
'menu_icon' =>
plugins_url( 'images/image.png', __FILE__ ),
'has_archive' => true
)
);
}
add_action( 'admin_init', 'my_admin' );
i add this code, but it shows in all new posts/pages i need default content only for plugins new post
add_filter( 'default_content', 'my_editor_content' );
function my_editor_content( $content ) {
$content = "This is some custom content I'm adding to the post editor because I hate re-typing it.";
return $content;
}
please advise ,thank you