hookItemsBrowseSql : public part vs admin panel


I need to put embargo on items, so I making a plugin to do this job.

I can filter items with the hook "hookItemsBrowseSql" when listing items in the public part (/items/browse), but this hook applies too in the admin panel (/admin/items). How can I know where the listing is for the public part or for the admin panel ?

Thank you.

You can use the is_admin_theme function to tell if you're on the admin or public side.

You might instead want to be checking for some permission (like the permission to view nonpublic items, or perhaps a privilege you create yourself), or checking whether there's a logged-in user, though.

Thank you, I'll have a look at this theme !

I could definitely see a use for this plugin. Thanks and looking forward to seeing the progress.


What are you needs ?