We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question, Runway

Check for Perch user

Hi

Is there anyway to check that a Perch user is logged into admin? I'd like to add help pages that are only accessible to editors.

Many thanks in advance,

Jon

Jonathan Elliman

Jonathan Elliman 27 points

  • 1 year ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

$Users = new PerchUsers;
$CurrentUser = $Users->get_current_user();

if (is_object($CurrentUser) && $CurrentUser->logged_in()) {
    // ... user is logged in
}

Fantastic. Thanks Drew!

Jon