Last active
May 7, 2019 14:02
-
-
Save NateWr/b728a9fc0c9ee5d5521a4a140071ef07 to your computer and use it in GitHub Desktop.
Remove the publishingMode setting from the access form for everyone except the site admin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove the publishingMode setting from the access form for | |
* everyone except the site admin | |
*/ | |
HookRegistry::register('Form::config::before', function ($hookName, $form) { | |
if (!defined('FORM_ACCESS') || $form->id !== FORM_ACCESS) { | |
return; | |
} | |
if (/* user is not an admin */) { | |
$form->removeField('publishingMode'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment