Jump to content

Delete some items from client area menu


Recommended Posts

Hi everybody!

I need to delete or hide some links from the sidebar into the client area, as in attachment

As they told me from the support I must do it using hooks, but I really don't know how to start

Any help you can give me will be welcome. 😄

Thanks!! 

hooks.png

Link to comment
Share on other sites

  • 1 month later...
<?php
use WHMCS\View\Menu\Item as MenuItem;

// Remove "Announcements" and "Support" links from the English version of WHMCS
add_hook('ClientAreaFooterOutput', 1, function ($vars) {
    $footerOutput = $vars['footerOutput'];

    // Remove the "Announcements" link from the footer
    $footerOutput = str_replace('<li><a href="announcements.php">Announcements</a></li>', '', $footerOutput);

    // Remove the "Support" link from the footer
    $footerOutput = str_replace('<li><a href="submitticket.php">Support</a></li>', '', $footerOutput);

    return $footerOutput;
});

// Remove "Announcements" and "Support" links from the Spanish version of WHMCS
add_hook('ClientAreaFooterOutput', 1, function ($vars) {
    $footerOutput = $vars['footerOutput'];

    // Remove the "Anuncios" link from the footer (in Spanish)
    $footerOutput = str_replace('<li><a href="anuncios.php">Anuncios</a></li>', '', $footerOutput);

    // Remove the "Soporte" link from the footer (in Spanish)
    $footerOutput = str_replace('<li><a href="submitticket.php">Soporte</a></li>', '', $footerOutput);

    return $footerOutput;
});

// Remove "Announcements" and "Support" links from the French version of WHMCS
add_hook('ClientAreaFooterOutput', 1, function ($vars) {
    $footerOutput = $vars['footerOutput'];

    // Remove the "Annonces" link from the footer (in French)
    $footerOutput = str_replace('<li><a href="annonces.php">Annonces</a></li>', '', $footerOutput);

    // Remove the "Support" link from the footer (in French)
    $footerOutput = str_replace('<li><a href="submitticket.php">Support</a></li>', '', $footerOutput);

    return $footerOutput;
});


?>

yo junto con chat GPT creamos estas funciones , aca se reemplaza algunos links del footer segun idioma,  remmplazamos el texto por un string vacio. Para cambiar otras secciones debes buscar el elemento que corresponde

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.

×
×
  • 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