1
2
<?php
add_filter( 'default_content', 'pu_default_editor_content' );
If you’re often writing the same kind of post (articles, lists, code snippets, etc) you may find very useful to pre-populate the WordPress editor with some custom content. Here’s a super easy code snippet to do it.
This code has to be pasted into your theme’s functions.php file. It can be customized to deal with custom post types, as shown on line 16 and after.
This code has to be pasted into your theme’s functions.php file. It can be customized to deal with custom post types, as shown on line 16 and after.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.