Advertisement
fauzanjeg

Add New Menu to Account Nav

Mar 11th, 2021 (edited)
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. /* Add New Menu to Account Nav */
  2. function add_menu_account_nav( $endpoint ) {
  3.     $item = array(
  4.         'custom_menu' => array(
  5.             'slug'  => 'author/' . wp_get_current_user()->user_login,
  6.             'label' => 'custom_menu',
  7.             'title' => esc_html__( 'Custom Menu', 'jnews' )
  8.         )
  9.     );
  10.     $endpoint = array_merge( $endpoint, $item );
  11.     return $endpoint;
  12. }
  13. add_filter( 'jnews_account_page_endpoint', 'add_menu_account_nav' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement