• Hello, I need to require the title field in the write post section. I’ve searched the various plugin site and this forum but have not found anything. Does anyone know how i can do this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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);

    ?>

    1. Copy that text (starting with <?php and ending with ?>) into a new text file
    2. Save the text file as require-titles.php
    3. Upload this to your /wp-content/plugins/ directory
    4. 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 ?>

    Thread Starter tophfro

    (@tophfro)

    Its a little dirty but works, Thanks for the help.

    Thread Starter tophfro

    (@tophfro)

    i noticed that when i hit the back button the post content feild is blank. is there a way to get the text back?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Requie Title’ is closed to new replies.