Jump to content

hook for hiding stuff on specific admin area pages


hanstavo

Recommended Posts

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.

Link to comment
Share on other sites

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 by Kian
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated