1

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!

1
  • Using the first characters of the post for the excerpt will not work? Because you're going to have to override that behavior as well if that's the case.
    – mor7ifer
    Commented Mar 5, 2012 at 14:10

2 Answers 2

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>';
}
1
  • Where should I put this code?... this looks like a frontend function for themes, I need it in the backend, in wp-admin/new page panel :) Commented Mar 8, 2012 at 1:06
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.