Skip to content

Instantly share code, notes, and snippets.

@manchumahara
Last active November 17, 2021 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manchumahara/0d877ae34d5bf65cfbea3ba39b47622d to your computer and use it in GitHub Desktop.
Save manchumahara/0d877ae34d5bf65cfbea3ba39b47622d to your computer and use it in GitHub Desktop.
Ultimate Member - finding the default login form id https://wordpress.org/plugins/cbxuseronline/
global $wpdb;
$args = array();
$default_login = $wpdb->get_var(
"SELECT pm.post_id
FROM {$wpdb->postmeta} pm
LEFT JOIN {$wpdb->postmeta} pm2 ON( pm.post_id = pm2.post_id AND pm2.meta_key = '_um_core' )
WHERE pm.meta_key = '_um_mode' AND
pm.meta_value = 'login' AND
pm2.meta_value = 'login' "
);
$args['form_id'] = $default_login;
$shortcode_attrs = '';
foreach ( $args as $key => $value ) {
$shortcode_attrs .= " {$key}=\"{$value}\"";
}
echo do_shortcode( "[ultimatemember {$shortcode_attrs} /]");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment