Created
February 2, 2020 21:42
-
-
Save wp-user-manager/255daeb154155916fa0b6d0b73a8fc9d to your computer and use it in GitHub Desktop.
WP User Manager - Add an external link to the Profile page tabs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_wpum_add_profile_tab_link( $tabs ) { | |
$tabs['google'] = [ | |
'name' => esc_html( 'Google' ), | |
'priority' => 2, | |
]; | |
return $tabs; | |
} | |
add_filter( 'wpum_get_registered_profile_tabs', 'my_wpum_add_profile_tab_link' ); | |
function my_wpum_get_profile_tab_url( $url, $tab ) { | |
if ( 'google' === $tab ) { | |
return 'https://www.google.com'; | |
} | |
return $url; | |
} | |
add_filter( 'wpum_get_profile_tab_url', 'my_wpum_get_profile_tab_url', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment