/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* -------- put default content into custom post type's main content box -------------- */ function my_preset_content() { global $post; if ( $post->post_content == '' and $post->post_type == 'custom_post_type' ) { $default_content = 'my preset content here'; } else { $default_content = $post->post_content; } return $default_content; } add_filter('the_editor_content', 'my_preset_content');
Comments
