Scoping custom Element Actions by specific site/sites #15159
-
I'd like to conditionally limit a custom action to only be available in certain source sites. Is there any way to sniff the active site for an element source for the purpose of registering site-specific element actions? (I initially thought to use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
currentSite
will always be the primary site for control panel requests. You can get the site that the element index is loading viacraft\helpers\Cp::requestedSite()
.