Skip to content

Instantly share code, notes, and snippets.

@nikitasinelnikov
Created May 10, 2021 14:41
Show Gist options
  • Save nikitasinelnikov/5af885ffedfc9b972d68913c94fffc05 to your computer and use it in GitHub Desktop.
Save nikitasinelnikov/5af885ffedfc9b972d68913c94fffc05 to your computer and use it in GitHub Desktop.
Ultimate Member: Activate ability to add users via registration form
//to make this ability possible for all registration forms on your website
add_filter( 'um_registration_for_loggedin_users', '__return_true' );
//to make this ability possible only for {selected registration form ID here}
function my_custom_um_registration_for_loggedin_users( $activate, $args ) {
if ( $args['form_id'] == '{selected registration form ID here}' ) {
$activate = true;
}
return $activate;
}
add_filter( 'um_registration_for_loggedin_users', 'my_custom_um_registration_for_loggedin_users', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment