Last active
October 28, 2020 19:55
-
-
Save wp-user-manager/e06dba03ff81239b40ff5c6df3d98616 to your computer and use it in GitHub Desktop.
WP User Manager - Add an external link to the Account page tabs
This file contains hidden or 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 wpum_account_add_external_link( $tabs ) { | |
$tabs['external'] = array( | |
'name' => 'My External Link', | |
'priority' => 100, | |
); | |
$tabs['another-external'] = array( | |
'name' => 'Another External Link', | |
'priority' => 100, | |
); | |
return $tabs; | |
} | |
add_filter( 'wpum_get_account_page_tabs', 'wpum_account_add_external_link' ); | |
function wpum_acccount_external_link( $tab_url, $step_key ) { | |
if ( 'external' === $step_key ) { | |
return 'https://externallink.com'; | |
} | |
if ( 'another-external' === $step_key ) { | |
return 'https://anotherexternallink.com'; | |
} | |
return $tab_url; | |
} | |
add_filter( 'wpum_get_account_tab_url', 'wpum_acccount_external_link', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment