Hello @redwiper
Users can login from any login forms. Sorry, but this is how it works now.
Regards.
@redwiper
You can replace the UM login shortcode with this shortcode:
[select_login_form member_form_id="385" user_form_id="3687"]
This code snippet will use one of the forms for login.
member_form_id if the URL has a member parameter like
https://domain.com/login/?member=true
and the user_form_id in all other cases.
add_shortcode( 'select_login_form', 'custom_select_login_form', 10, 2 );
function custom_select_login_form( $attrs, $content ) {
$login_form_id = false;
if ( isset( $_REQUEST['member'] ) && isset( $attrs['member_form_id'] )) {
$login_form_id = sanitize_text_field( $attrs['member_form_id'] );
} else {
if ( isset( $attrs['user_form_id'] )) {
$login_form_id = sanitize_text_field( $attrs['user_form_id'] );
}
}
if ( ! empty( $login_form_id ) && is_numeric( $login_form_id )) {
if ( version_compare( get_bloginfo( 'version' ), '5.4', '<' ) ) {
echo do_shortcode( '[ultimatemember form_id="' . $login_form_id . '"/]' );
} else {
echo apply_shortcodes( '[ultimatemember form_id="' . $login_form_id . '"/]' );
}
}
}
Install the code snippet into your active theme’s functions.php file
or use the “Code Snippets” plugin.
https://wordpress.org/plugins/code-snippets/
Hi @redwiper
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