Skip to content

Instantly share code, notes, and snippets.

@laxmariappan
Created July 19, 2020 04:08
Show Gist options
  • Save laxmariappan/c1233b143b0ee0d1a3033ef5daf6e0a9 to your computer and use it in GitHub Desktop.
Save laxmariappan/c1233b143b0ee0d1a3033ef5daf6e0a9 to your computer and use it in GitHub Desktop.
WordPress Ultimate Member - Edit account and profile link on profile menu tabs
<?php
// taken from https://gist.github.com/ultimatemember/8cdaf61e7bd9de35512c#gistcomment-3034086
// tested - it works
// Filter
function um_add_custom_tabs( $tabs ) {
$tabs['account'] = array(
'name' => 'Edit Account',
'icon' => 'um-faicon-pencil',
'custom' => TRUE
);
$tabs['profile'] = array(
'name' => 'Edit Profile',
'icon' => 'um-faicon-pencil',
'custom' => TRUE
);
return $tabs;
}
add_filter( 'um_profile_tabs', 'um_add_custom_tabs', 1000 );
// Action
function um_profile_content_edit_account_default( $args ) {
echo do_shortcode('[ultimatemember_account]');
}
add_action( 'um_profile_content_account_default', 'um_profile_content_edit_account_default' );
function um_profile_content_profile_default( $args ) {
wp_redirect( "/user?profiletab=main&um_action=edit" );
}
add_action( 'um_profile_content_profile_default', 'um_profile_content_profile_default' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment