hanstavo Posted October 19, 2018 Share Posted October 19, 2018 Is it possible to use a hook to hide stuff on specific admin area pages? For example I want to use a hook to hide the support ticket information in the myaccount.php , but the id are used elsewhere so cant use css to hide by IDs for admins as we dont use support tickets, and its confusing alot of our staff. I need a hook,css,or js options that whmcs alows to edit or use. Hope this is making since. 1 Quote Link to comment Share on other sites More sharing options...
hanstavo Posted October 20, 2018 Author Share Posted October 20, 2018 I figured out a way but its not working: <?php function custom($vars){ if ($vars['pagetitle'] == 'My Account') { return <<<HTML <script> window.alert('test'); </script> HTML; } } add_hook('AdminAreaPage', 1, 'custom'); ?> 1 Quote Link to comment Share on other sites More sharing options...
Kian Posted October 20, 2018 Share Posted October 20, 2018 (edited) First off don't use $vars['pagetitle'] since its value depends on your system language. Second the hook point is wrong. Here's the working code. <?php add_hook('AdminAreaHeadOutput', 1, function($vars) { if ($vars['filename'] == 'myaccount') { return '<script type="text/javascript">alert('Hello!');</script>'; } }); Edited October 20, 2018 by Kian 2 Quote Link to comment Share on other sites More sharing options...
hanstavo Posted October 20, 2018 Author Share Posted October 20, 2018 58 minutes ago, Kian said: First off don't use $vars['pagetitle'] since its value depends on your system language. Second the hook point is wrong. Here's the working code. <?php add_hook('AdminAreaHeadOutput', 1, function($vars) { if ($vars['filename'] == 'myaccount') { return '<script type="text/javascript">alert('Hello!');</script>'; } }); Thank you! It worked. 1 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.