Filter: um_access_restricted_post_instance

apply_filters( 'um_access_restricted_post_instance', $filtered_post, $post, $query ) → {object}

Filters restricted via Ultimate Member settings post instance.

Parameters:
Name Type Description
$filtered_post object

Restricted WP_Post instance.

$post object

Base WP_Post instance before restriction settings apply.

$query object

WP_Query for getting posts.

Since:
  • 2.8.2
Source:
Returns:

Restricted WP_Post instance.

Type
object
Example

Change restricted post title to custom one.

function restricted_post_instance( $filtered_post, $original_post, $query ) {
    // your code here
    $filtered_post->post_title = 'This post is restricted';
    return $filtered_post;
}
add_filter( 'um_access_restricted_post_instance', 'restricted_post_instance', 10, 3 );