WP User Manager - Add an external link to the Account 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 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