*

StefanGr

  • ***
  • 51 posts
Change the user menu order
« on: February 06, 2022, 04:06:48 PM »
Hello,
So i need to re arange the user menu in a different way.  as i saw it's in functions.php , and as far i can understand the menu from different plugins is shown by this part.
Code: [Select]
osc_run_hook('user_menu_items');
  foreach($options as $o) {
    if($o['section'] == 2) {
      $active_class = ($current_url == $o['url'] ? ' active' : '');
      echo '<li class="' . $o['class'] . $active_class . '" ><a href="' . $o['url'] . '" >' . $o['name'] . '</a></li>';
    }
  }

  osc_run_hook('user_menu');

  foreach($options as $o) {
    if($o['section'] == 3) {
      $active_class = ($current_url == $o['url'] ? ' active' : '');
      echo '<li class="' . $o['class'] . $active_class . '" ><a href="' . $o['url'] . '" >' . $o['name'] . '</a></li>';
    }
  }

So.. how can i change the line up, and show the user a different order ? To my undestanding this is a loop trough activated plugin and displaying their menu output, but no option to configure what is displayed to the end user.
 
;) nothing here, move on.

Marked as best answer by StefanGr on February 07, 2022, 06:36:08 PM
*

MB Themes

Re: Change the user menu order
« Reply #1 on: February 07, 2022, 09:33:28 AM »
@StefanGr
Key is to modify it in plugins.
This is part in theme:   osc_run_hook('user_menu');

If you see in plugin osc_add_hook('user_menu', 'some function'), you can add 3rd parameter as "priority" (1-10).


osc_add_hook('user_menu', 'some function A', 1)
osc_add_hook('user_menu', 'some function B', 10)

function A will be executed prior to function B.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

StefanGr

  • ***
  • 51 posts
Re: Change the user menu order
« Reply #2 on: February 07, 2022, 06:19:32 PM »
Thx, i'll try to figure it out.

--
Found out for other plugins, but i can't figure it out how to move the im message menu :(

--
P.S - a plugin / update to the theme to do that would be great.
« Last Edit: February 07, 2022, 06:47:25 PM by StefanGr »
;) nothing here, move on.

*

MB Themes

Re: Change the user menu order
« Reply #3 on: February 08, 2022, 09:39:49 AM »
Will be pretty much same (if added to user_menu hook)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots