Add default text to new article
-
Hi all
how can I add default text to a new article..
i tried this
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;
and this
function preset_content() { global $post; if ( $post->post_content == '' and $post->post_type == 'post' ) { $default_content = 'my preset content text'; add_post_meta($post->ID, 'my custom field', 'my value', true); } else {$default_content = $post->post_content;} return $default_content; } add_filter('the_editor_content', 'preset_content');
in wp-includes/function.php
but i only get errors..
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Add default text to new article’ is closed to new replies.