Really Simple Plugins

Ultimate Member keep me signed in option not possible to disable

Popular articles

Woocommerce Moneybird

Link your WooCommerce webshop to your Moneybird account, and synchronize all payments to an invoice in Moneybird automatically! With WooCommerce Moneybird all your sales will

Read More
Share on facebook
Share on twitter
Share on linkedin

If you use Ultimate Member, you might have come across the issue that it’s not possible to disable the “keep me signed in” checkbox, when on the login page.

This is caused by the validation javascript in Ultimate Member, located in um-conditional.js. From each um-field class element, the data attribute “key” is retrieved. But this checkbox does not have the data attribute “key”, causing the script to fail.

I’ve noticed this bug has been reported to Ultimate Member, so it will probably be fixed in the next release, but for now, you can simply fix it by adding one line to the script.

In wp-content/plugins/ultimate-member/assets/js you can find um-conditional.js.

Look up the function

um_apply_conditions()

Then, after the line

var key = $dom.parents(‘.um-field[data-key]’).data(‘key’);
Insert:
if (!key) return;

That should fix your problem.

* Edit *

In response to questions, I’ve checked this again, and it appears Ultimate Member has NOT fixed this in their latest updates. I’ll send them a note about this.

The above fix will work, but as the non minified script files will only load when debugging is enabled, you should also minify this script, for example here, then replace the .min version of the file: um-conditional.min.js in the same directory.

This has the disadvantage that it will get overwritten when you update Ultimate Member, so you should move the file to a different folder, then add some php to your functions.php:

add_action( 'wp_enqueue_scripts',  'ioh_enqueue_scripts', 999);
function ioh_enqueue_scripts()
{
    wp_deregister_script('um_conditional');
    wp_register_script('um_conditional', get_template_directory() . 'js/um-conditional.min.js', array('jquery', 'jquery-masonry'), 1, true);
}

This will deregister the default Ultimate Member script, then registers your own, customized one.

This works for me, so it should work for you 😉

 

Related articles

Subscribe

Vacature: Stage Development!