Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * Add custom tab to user settings menu
- *
- * @param array $menu
- *
- */
- add_filter( 'streamtube/core/user/dashboard/menu/items', function( $menu ){
- $tab = array(
- 'slug' => 'custom-tab',
- 'text' => esc_html__( 'Custom Tab', 'streamtube' ),
- 'icon' => 'icon-star'
- );
- /**
- * Declare menu icon class
- * @link https://streamtube.marstheme.com/icons/
- */
- $menu_icon = 'icon-star';
- $menu['settings']['submenu'][ $tab['slug'] ] = array(
- 'title' => $tab['text'],
- 'icon' => $tab['icon'],
- 'callback' => function(){
- ?>
- <!-- Custom Content -->
- <p>
- Hello World
- </p>
- <?php
- // For instance, print current logged in username using shortcode
- echo do_shortcode( '[user_name user_id="logged_in"]' );
- },
- 'priority' => 100
- );
- return $menu;
- }, 10, 1 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement