I know you can customize the placeholder default text of the 'Post Title' field, but is there any way to display placeholder content in the actual TinyMCE post editor? Ideally I'd like to display several paragraphs of HTML formatted content in the editor as a placeholder / instructions.
-
adjusted question title so other people may find this if they are looking for the same thing.– davidcondreyCommented Jul 3, 2014 at 5:28
Add a comment
|
2 Answers
There is no way to add "placeholder" for TinyMCE, but you can set default content for newly created posts. All you need is just to hook default_content
filter and return your formatted paragraphs:
add_filter( 'default_content', 'wpse8170_get_default_instructions', 10, 2 );
function wpse8170_get_default_instructions( $content, WP_Post $post ) {
if ( $post->post_type == 'post' ) {
$content = '.... your content ....';
}
return $content;
}
-
That's actually what I was looking for, not placeholder. Thanks. Commented Jul 3, 2014 at 5:26
Here's a TinyMCE plugin I adapted to work with WordPress, does exactly what you need without actually setting it as the content: