diff --git a/includes/core/class-access.php b/includes/core/class-access.php index 482abc6d..9f1cc02a 100644 --- a/includes/core/class-access.php +++ b/includes/core/class-access.php @@ -761,6 +761,8 @@ if ( ! class_exists( 'um\core\Access' ) ) { return $content; } + $original_post_content = $content; + if ( $this->is_restricted( $id ) ) { $restriction = $this->get_post_privacy_settings( $id ); @@ -770,8 +772,31 @@ if ( ! class_exists( 'um\core\Access' ) ) { $content = ! empty( $restriction['_um_restrict_custom_message'] ) ? stripslashes( $restriction['_um_restrict_custom_message'] ) : ''; } - // translators: %s: Restricted post message. - $content = sprintf( __( '%s', 'ultimate-member' ), $content ); + // Because we have a late the_content callback priority here we have to apply shortcodes if faced in restricted message. + $content = apply_shortcodes( $content ); + /** + * Filters the restricted post content. + * Can be used for translations when site is multilingual. + * + * @param {string} $content Post content prepared from restricted message. + * @param {int} $post_id Post ID + * @param {string} $original_post_content Original post content. + * + * @return {string} Maybe changed post content prepared from restricted message. + * + * @since 2.8.7 + * @hook um_restricted_post_content + * + * @example