- 2.2.1 prepare to the release;

This commit is contained in:
Nikita Sinelnikov
2021-07-30 14:20:11 +03:00
parent 250a4ded5c
commit c765d03ce4
7 changed files with 34 additions and 14 deletions
+11 -3
View File
@@ -850,12 +850,20 @@ if ( ! class_exists( 'um\core\Access' ) ) {
* Replace titles of restricted posts
*
* @param string $title
* @param int $id
* @param int|null $id
*
* @return string
*/
function filter_restricted_post_title( $title, $id ) {
if ( is_numeric( $id ) && $this->is_restricted( $id ) ) {
function filter_restricted_post_title( $title, $id = null ) {
if ( ! isset( $id ) ) {
return $title;
}
if ( ! is_numeric( $id ) ) {
$id = absint( $id );
}
if ( $this->is_restricted( $id ) ) {
$restricted_global_title = UM()->options()->get( 'restricted_access_post_title' );
$title = stripslashes( $restricted_global_title );
}