Try this:
<?php
/*
Plugin Name: Require a Title
*/
function require_title_for_posts($title='') {
if ( '' == $title )
die('You must provide a title! Press the "back" button in your browser to correct this.');
return $title;
}
add_filter('title_save_pre', 'require_title_for_posts', 0);
?>
- Copy that text (starting with
<?php and ending with ?>) into a new text file
- Save the text file as
require-titles.php
- Upload this to your
/wp-content/plugins/ directory
- Activate the plugin via your WP admin
If you see “headers already sent” errors, check the uploaded file for blank space before the opening <?php or after the closing ?>
Its a little dirty but works, Thanks for the help.
i noticed that when i hit the back button the post content feild is blank. is there a way to get the text back?