• Development
  • Management
  • Case Studies
  • Testimonials
  • Get Started
  • Home
  • Development
  • Management
  • Testimonials
  • Case Studies
  • Get Started

Home / Plugins / Mandatory Excerpt / Filters

Filters

for Mandatory Excerpt, a WordPress plugin

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 );

Request a Quote

Thanks for taking the time to learn about what we can do for you. When you’re ready, send us some brief information about you and your project. We’ll follow up with you and together we’ll develop a game plan.

Please do not put any passwords into this form. Once we’ve had a chance to speak we’ll arrange for a secure way to transmit all the info we’ll need.

Custom sites typically start at $4000.

Combined.3

Mike is a content strategist, designer and developer. With over 17 years of experience, he'll help plan and structure your web content, bringing it to life in a beautiful and effective design.

Quick Links

  • Web Design + Development
  • WordPress Site Management
  • My Plugins
hello@codenamemiked.com 613-866-7164

© 2003-2020 All Rights Reserved

© 2003- All Rights Reserved Site by <use xlink:href="/assets/cnmd-footer.svg#cnmd-logo-darker">