Advertisement
arie_cristianD

add custom link in my account dropdown

Nov 13th, 2024 (edited)
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. add_filter( 'jnews_dropdown_link', 'additional_link_my_account' );
  2.  
  3. function additional_link_my_account( $dropdown ) {
  4.     if ( is_user_logged_in() ) {
  5.         $item['customer'] = array(
  6.             'text' => 'Customer', /* dropwon link Text */
  7.             'url'  => 'https://jnews.io/',  /* dropwon link URL */
  8.         );
  9.  
  10.         if ( isset( $item ) ) {
  11.             $dropdown = array_merge( $item, $dropdown );
  12.         }
  13.     }
  14.  
  15.     return $dropdown;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement