function tm_restrict_core() { $is_page_restricted = get_post_meta(get_the_ID(), 'tm_is_page_restricted', true); if ('yes' == $is_page_restricted && !is_home()) { if (!tm_is_user_allowed()) { tm_redirect_unallowed_user(); } } }
function test_is_guest_restricted() { // for refactoring we might fetch a settings. // and use assertEquals instead. $this->assertFalse(tm_is_user_allowed()); }