Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional User private Profile Forms #3

Open
MissVeronica opened this issue Apr 2, 2024 · 0 comments
Open

Additional User private Profile Forms #3

MissVeronica opened this issue Apr 2, 2024 · 0 comments

Comments

@MissVeronica
Copy link

MissVeronica commented Apr 2, 2024

Try this code snippet for additional User profile forms dedicated for User private information together with the "Split profile form" plugin.
Install the code snippet into your active theme's functions.php file or use the "Code Snippets" plugin.

add_filter( 'template_include', 'select_profile_submenu_required', 10, 1 );

function select_profile_submenu_required( $template ) {

    global $current_user;

    if ( um_is_core_page( 'user' ) && $current_user->ID != um_profile_id()  && isset( UM()->classes['UM_Profile_Forms'] )) {
        remove_filter( 'template_include', array( UM()->classes['UM_Profile_Forms'], 'customize_profile' ), 20 );
        remove_filter( 'um_profile_edit_menu_items', array( UM()->classes['UM_Profile_Forms'], 'profile_edit_menu_items' ), 20 );
        remove_filter( 'um_myprofile_edit_menu_items', array( UM()->classes['UM_Profile_Forms'], 'profile_edit_menu_items' ), 20 );
    }
    return $template;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant