From ce19c1fbdc15143e7684bed45877484b3b69766b Mon Sep 17 00:00:00 2001 From: yuriinalivaiko Date: Fri, 30 Jul 2021 13:03:51 +0300 Subject: [PATCH] Fix PHP notice that appears if parameter $id in the method UM()->access()->filter_restricted_post_title( $title, $id ) is empty. --- includes/core/class-access.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/core/class-access.php b/includes/core/class-access.php index d7820076..48b8f032 100644 --- a/includes/core/class-access.php +++ b/includes/core/class-access.php @@ -847,13 +847,15 @@ if ( ! class_exists( 'um\core\Access' ) ) { /** - * @param $title - * @param $id + * Replace titles of restricted posts + * + * @param string $title + * @param int $id * * @return string */ function filter_restricted_post_title( $title, $id ) { - if ( $this->is_restricted( $id ) ) { + if ( is_numeric( $id ) && $this->is_restricted( $id ) ) { $restricted_global_title = UM()->options()->get( 'restricted_access_post_title' ); $title = stripslashes( $restricted_global_title ); }