Advertisement
arie_cristianD

add custom menu to my account dropdown

Feb 19th, 2025
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. add_filter( 'jnews_dropdown_link', 'additional_link_my_account', 99 );
  2.  
  3. function additional_link_my_account( $dropdown ) {
  4.     if ( is_user_logged_in() ) {
  5.  
  6.         /* add custom menu item */
  7.         $item['custom-menu'] = array(
  8.             'text' => 'Custom Menu', /* dropwon link Text */
  9.             'url'  => esc_url( jnews_home_url_multilang( 'account/custom-menu' ) ),  /* dropwon link URL */
  10.         );
  11.  
  12.         if ( isset( $item ) ) {
  13.             $dropdown = array_merge( $item, $dropdown );
  14.         }
  15.     }
  16.  
  17.     return $dropdown;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement