Is there a way to have conditional code per user type?

Hi!

In WordPress, I can do this:

if ( ! is_admin() ) {
THIS ONLY LOADS IF THE PERSON VIEWING A SITE ISN’T AN ADMIN IN WP
}

Is there anything similar to conditionally load code based on user role in Ghost? We have a plugin for Ghost, and this would be helpful to know, and I can’t find it in the documentation.

Cheers!

Not officially, but you could probably check for the existence of the admin auth cookie :slight_smile:

Thanks! Now we just have to figure out how to do that, so I can write a support doc.

(FYI: It’s because some Ghost users are asking about our Fathom tracker not tracking them if they’re logged into Ghost.)