mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Fix PHP notice that appears if parameter $id in the method UM()->access()->filter_restricted_post_title( $title, $id ) is empty.
This commit is contained in:
@@ -847,13 +847,15 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $title
|
* Replace titles of restricted posts
|
||||||
* @param $id
|
*
|
||||||
|
* @param string $title
|
||||||
|
* @param int $id
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function filter_restricted_post_title( $title, $id ) {
|
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' );
|
$restricted_global_title = UM()->options()->get( 'restricted_access_post_title' );
|
||||||
$title = stripslashes( $restricted_global_title );
|
$title = stripslashes( $restricted_global_title );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user