From a06072563a805da062c01f48235b89658d61827b Mon Sep 17 00:00:00 2001 From: Nikita Sinelnikov Date: Thu, 5 Aug 2021 13:55:31 +0300 Subject: [PATCH] - added hook for ignore changing post title in the_title() function if the post is restricted; --- includes/core/class-access.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/core/class-access.php b/includes/core/class-access.php index ac673484..3db7f43b 100644 --- a/includes/core/class-access.php +++ b/includes/core/class-access.php @@ -869,6 +869,11 @@ if ( ! class_exists( 'um\core\Access' ) ) { } if ( $this->is_restricted( $id ) ) { + $ignore = apply_filters( 'um_ignore_restricted_title', false, $id ); + if ( $ignore ) { + return $title; + } + $restricted_global_title = UM()->options()->get( 'restricted_access_post_title' ); $title = stripslashes( $restricted_global_title ); }