Filter: um_ignore_restricted_excerpt

apply_filters( 'um_ignore_restricted_excerpt', $ignore, $post_id ) → {bool}

Filters a marker for ignoring restricted post excerpt changes.

Note: Use with caution! You can make your posts not restricted by using this filter hook.

Parameters:
Name Type Description
$ignore bool

Marker for ignoring restricted post excerpt changes. Default false. Set to true if you want to ignore and show real content.

$post_id int

Post ID.

Since:
  • 2.2.3
Source:
Returns:

Marker for ignoring restricted post excerpt changes.

Type
bool
Examples

Leave real post excerpt even they are restricted. By post ID (for ID = 400).

function change_restricted_excerpt( $ignore, $id ) {
    // your code here
    if ( 400 === $id ) {
        $ignore = true;
    }
    return $ignore;
}
add_filter( 'um_ignore_restricted_excerpt', 'change_restricted_excerpt', 10, 2 );

Leave real post excerpt even they are restricted. For all posts: site-wide logic.

add_filter( 'um_ignore_restricted_excerpt', '__return_true' );