Print a message if excerpt is empty after posts have been publish/update!

I don’t think I can make the excerpt required, but if anyone knows a workaround please share.
At least I want to print a message if excerpt is empty after posts have been publish/update, maybe a red notification to be more visible!

I use this script to show excerpt box by default!

Related posts

Leave a Reply

2 comments

  1. You could always use the has_excerpt() function to test for excerpt content and if it is not filled in you could display a message.

    Example:

    if( has_excerpt() ) {
        the_excerpt();
    } else {
        echo '<p>Please enter the excerpt.</p>';
    }
    
  2. For updateing, you could use the pre_post_update action hook, and if there is no excerpt you could prevent the post being updated and display an error message, but it doesn’t look like you can stop the new post from being created.