What the title says. There’s no indication in the excerpt panel that the excerpt is required. THe plugin does, however, disable the “publish” button.
]]>How to make Mandatory Excerpts for WordPress to work with Woocommerce to make excerpt (product short description) mandatory?
I tried this without success
$valid_post_types = apply_filters( ‘mandatory_excerpt_post_types’, array( ‘post’, ‘product’ ) );
Thanks
]]>This is to anyone who is looking for a help on how to apply filters described in this documentation which I found super confusing.
In order to apply mandatory excerpt to only certain post type you’ll need to add a filter code in your child theme’s function.php, e.g. to require excerpt only in post
type:
function require_excerpt_only_in_posts() {
return ['post'];
}
add_filter( 'mandatory_excerpt_post_types', 'require_excerpt_only_in_posts');
]]>
Hi, pardon my inexperience with the filters, but I’m not entirely sure what to un-comment/format in the examples you show.
We have a custom post type called “Articles” that have excerpts I want to make mandatory. I just need a little more guidance on setting up the function.
Also, does this go back and unpublish already published articles if they don’t have an excerpt? I’m asking because that would unpublish a majority of articles. I’m looking to require excerpts moving forward.
Thank you!
]]>