There are several filters you can use to control and customize Mandatory Excerpts.
mandatory_excerpt_post_types
Allows you to set which post types this plugin will actually apply to. Used by Gutenberg and Classic Editor.
/** * Adjust the post types for which the excerpt would be required. * * @param array $this->reset_these_status { * If the post has any of these post types, the post will be checked for a valid excerpt. * Default is [ 'post', 'page' ] * @type string A valid post type * } * @since 1.0.0 */ $valid_post_types = apply_filters( 'mandatory_excerpt_post_types', array( 'post', 'page' ) );
mandatory_excerpt_reset_these_status
If a post has any of these status’ and the excerpt is not set, the post status will be reset to ‘draft’. Used by Classic Editor only.
/** * After it has been determined that the excerpt is required but missing, if the post's status is one of these * then it will be reset to 'draft'. * * @param array $this->reset_these_status { * If the post has any of these status' the post status will be reset to 'draft'. * Default is [ 'publish', 'future', 'pending' ] * @type string A valid post status * } * @since 1.0.0 */ $reset_these_status = apply_filters( 'mandatory_excerpt_reset_these_status', $this->reset_these_status );
mandatory_excerpt_skip_these_status
If a post has any of these status’ the check for the excerpt will be skipped. Used by Classic Editor only.
/** * Adjust the post status types that will will cause the check for the excerpt to be skipped. * * @param array $this->skip_these_status { * If the post has any of these status' the check for the excerpt will be skipped. * Default is [ 'trash', 'draft', 'auto-draft' ] * @type string A valid post status * } * @since 1.0.0 * */ $skip_these_status = apply_filters( 'mandatory_excerpt_skip_these_status', $this->skip_these_status );