Last active
November 17, 2021 10:31
-
-
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/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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