• Resolved ofiraa

    (@ofiraa)


    Hello, I created a registration form
    I want to use it as administrator only
    Only the administrator can register users
    But when I’m logged in, it doesn’t show me the form because I’m supposedly already registered on the site.

    what should I do?

Viewing 3 replies - 1 through 3 (of 3 total)
  • missveronica

    (@missveronicatv)

    @ofiraa

    Yes, it’s possible if you enable the Registration form for logged-in users
    and pre-fill the Registration Form with default values with this code snippet:

    add_filter( 'um_registration_for_loggedin_users', '__return_true' );
    add_filter( 'um_field_value', 'um_field_value_admin_registration', 10, 5 );
    
    function um_field_value_admin_registration( $value, $default, $key, $type, $data ) {
    
        if( UM()->fields()->set_mode == 'register' ) {
            $value = $default;
        }
        return $value;
    }

    Add the code snippet to your active theme’s functions.php file
    or use the “Code Snippets” plugin.

    https://www.ads-software.com/plugins/code-snippets/

    missveronica

    (@missveronicatv)

    @ofiraa

    I have made an “Admin User Registrations” plugin of the code snippet
    for easier installations and activation.

    https://github.com/MissVeronica/um-admin-user-registrations

    Plugin Support andrewshu

    (@andrewshu)

    Hi @ofiraa

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. ??

    Regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘registration form only use admin’ is closed to new replies.