zitu4life Posted August 19, 2019 Share Posted August 19, 2019 Hello There How can we change this hook in way that we could choose wanted $permissions = $vars['allPermissions']; to hide\remove then from the list. <?php /** * Filter SubAccounts Permissions Hook * @author brian! */ function subcontacts_permissions_filter_hook($vars) { $permissions = $vars['allPermissions']; $disallowed = ['manageproducts','domains']; foreach ($permissions as $k => $item) { if (in_array($item,$disallowed)) { unset($permissions[$k]); } } return array("allPermissions" => $permissions); } add_hook("ClientAreaPageContacts", 1, "subcontacts_permissions_filter_hook"); Also, we have Sub-account Permissions on Admin, same hook can we have a modified hook to work on Admin to. This hook were made by @brian! regardsSub 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 20, 2019 Share Posted August 20, 2019 12 hours ago, zitu4life said: How can we change this hook in way that we could choose wanted to hide\remove then from the list. by changing the values in the $disallowed array. $disallowed = ['manageproducts','domains']; the option values you can changes are listed below.. 12 hours ago, zitu4life said: Also, we have Sub-account Permissions on Admin, same hook can we have a modified hook to work on Admin to. no. 0 Quote Link to comment Share on other sites More sharing options...
zitu4life Posted August 20, 2019 Author Share Posted August 20, 2019 It is supose to work like that but it still do not work, can you try it in your end @brian! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 20, 2019 Share Posted August 20, 2019 1 hour ago, zitu4life said: It is supose to work like that but it still do not work, can you try it in your end @brian! it works for me in v7.7.1 - with the hook disabled... ...with it enabled... what you might want to try is using the old-fashioned way to declare an array and see if that helps... $disallowed = array('manageproducts','domains'); 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.