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

  • 3 years 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