[ad_1]
@chefranov
You can read this guide about “Content Restriction”
https://docs.ultimatemember.com/article/1736-content-restriction
Your first echo with the link is the page content
and the second echo is the “Restricted Access Message”.
But I need do it via PHP code on another page.
I have pages:
– Main
— Subpage
I would like to check access to subpage from main page
@chefranov
.../plugins/ultimate-member/includes/core/class-access.php line 2060
UM()->access()->is_restricted( $post_id );
/**
* Is post restricted?
*
* @param int $post_id
* @param bool $on_single_page
* @param bool $ignore_cache
* @return bool
*/
function is_restricted( $post_id, $on_single_page = false, $ignore_cache = false ) {
It works perfect! Thank you!
