Advertisement
fauzanjeg

Change dropdown_link in AccountPage.php

Dec 23rd, 2020
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. public function dropdown_link( $dropdown )
  2.     {
  3.         if ( is_user_logged_in() )
  4.         {
  5.             $item['account'] = array(
  6.                 'text' => jnews_return_translation($this->endpoint['account']['title'], 'jnews', $this->endpoint['account']['label']),
  7.                 'url'  => esc_url( home_url( '/' . $this->endpoint['account']['slug'] ) )
  8.             );
  9.            
  10.             if ( isset( $item ) )
  11.             {
  12.                 if (in_array('account', $dropdown)) {
  13.                     $dropdown = array_merge( $dropdown, $item );
  14.                 } else {
  15.                     $dropdown = array_merge( $item, $dropdown );
  16.                 }
  17.             }
  18.         }
  19.  
  20.         return $dropdown;
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement