0

Add hooks on formatUserName

SebastienH il y a 2 ans 0

Hi all,
It would be great if two hooks were added on the formatUserName function of the inc/dbutils.class.php file.
Something like : 

Plugin::doHook("pre_format_username", [
            'ID'           => $ID,
            'login'        => $login,
            'realname'     => $realname,
            'firstname'    => $firstname,
            'link'         => $link,
            'cut'          => $cut,
            'force_config' => $force_config
      ]);

AND

Plugin::doHook("post_format_username", [
            'ID'           => $ID,
            'login'        => $login,
            'realname'     => $realname,
            'firstname'    => $firstname,
            'link'         => $link,
            'cut'          => $cut,
            'force_config' => $force_config,
            'username_substrings'=>[
                'before'    => &$before,
                'formatted' => &$formatted,
                'after'     => &$after
             ]
      ]);

Thi is not perfect, just an idea to avoid people having to edit the core files when they want tu customize the display.