Michael
Forum Replies Created
-
Thank you so much, the
pireg_after_verification_usershook did do the trick!In case anyone else could use it, here’s my aproach:
add_action( 'pireg_after_verification_users', 'zbx_verify_user' ); function zbx_verify_user( $user ) { $user_id = $user->ID; $invite_code = get_user_meta( $user_id, 'invite_code', true ); if ( $invite_code && $invite_code != '' ) { // Get all users registered with this invite code global $wpdb; $user_ids = $wpdb->get_results( "SELECT user_id FROM {$wpdb->prefix}usermeta WHERE meta_key LIKE 'invite_code' AND meta_value LIKE '$invite_code'", ARRAY_A ); // Sort out current user and clean up array $other_user_ids = array(); foreach ( $user_ids as $val ) { if ( $val['user_id'] != $user_id ) $other_user_ids[] = $val['user_id']; } // If any found, DELETE(!) other users if ( !empty( $other_user_ids ) ) { foreach ( $other_user_ids as $val ) { wp_delete_user( $val ); } } // Deactivate invite code $wpdb->update( $wpdb->prefix.'pieregister_code', array( 'status' => 0, ), array( 'name' => $invite_code ), array( '%d' ), array( '%s' ) ); } }Careful, I assume that there aren’t any legit users with the same invite code, so I delete all other users. Keep this in mind when using this code.
Thanks again. Well, my solution for this would be: On activation of a new user account, search for other users that have the same activation key in their user_meta using a wpdb query:
SELECT
user_idFROMwp_usermetaWHEREmeta_keyLIKE 'invite_code' ANDmeta_valueLIKE 'ZBX3-8IK9'If such users are found, those users should all be inactive, but one could check this additionally to be sure. Next delete them (or disable or whatever) and in any case *now* disable the invitation code.
So the fact that the key is stored in the user_meta wouldn’t be a real trouble if I ounly could hook into the activation process.
- This reply was modified 4 years, 6 months ago by Michael.
Thanks for your reply! I’m using the premium version, but iviting through email isn’t an option in my case: My customer wants/needs to hand out invitation codes to yet unknown users in “real life” so they can come back to the website and register.
Does Pie Register offer any hooks? Couldn’t find anything about that in the documentation, but it seems there are some?
Forum: Plugins
In reply to: [Caldera Forms Anti Spam] Broken in WP 5.6Switching down to jQuery 2.2.4 (using jQuery Manager) solves the reCAPTCHA issue for me, but then some advanced form features (like ‘show field X only when checkbox Y is ckecked’) will stop working. So that’s not an option.
My workaround in the meantime: I create a duplicate version of the form without reCAPTCHA and then use the plugin ‘Conditional Display for Mobile’ to show the reCAP-less version in case of Firefox and the ‘regular’ version in all other cases. Looks like this:
[wonderplugin_cond browserexclude="Firefox"] [caldera_form id="<<regular form>>"] [/wonderplugin_cond] [wonderplugin_cond browserinclude="Firefox"] [caldera_form id="<<reCAP-less form>>"] [/wonderplugin_cond]No good solution at all, but for the moment that’s the best compromise for me.
Forum: Plugins
In reply to: [WP Popular Posts] WP Popular Posts suddenly stopped countingGreat @hcabrera, you hit it!
I’ve added ‘wordpress-popular-posts’ to the allowed REST API namespaces in WP Cerber, and I immediately can see some counts. Pretty cool.
Many thanks to you!
Forum: Plugins
In reply to: [WP Popular Posts] WP Popular Posts suddenly stopped countingThanks @hcabrera,
so I’m glad not having tried the “uninstall/re-insall” trick. 🙂
The site is http://www.lanline.de and here you are the installed plugins:
- ACF Content Analysis for Yoast SEO
- Activity Log
- Auto-hyperlink URLs
- Benutzerrolleneditor Pro
- Co-Authors Plus
- Core Control
- Custom Post Type UI
- Eigene Felder
- Force Regenerate Thumbnails
- Import User from text file
- Ninja Forms
- Quick Page/Post Redirect Plugin
- Related Posts for WordPress Premium
- Relevanssi
- Secondary Title
- Shortcodes Ultimate
- Show Latest Post Thumbnail Widget
- Text Truncator
- User Switching
- Widget CSS Classes
- WordPress Popular Posts
- WP Bitly
- WP Cerber Security & Antispam
- WP Real Media Library
- Yoast SEO
Forum: Fixing WordPress
In reply to: Can’t identify originator of Update Error MessageSorry @aaronrobb, I should have posted the result of my research here.
It was the plugin “Related Posts for WordPress” from Never5. They (quite silently) released a new subscription-based version of their plugin. We’ve had the previous premium version installed, which was a one-time payment plugin.
Forum: Fixing WordPress
In reply to: Can’t identify originator of Update Error MessageThank you, Jacob!
I thought the message came from the wp core system, but you were right and I could finally find the bad guy. I’ll contact the developer about this.
Again, thanks to both of you for your support!
Cheers,
MichaelForum: Fixing WordPress
In reply to: Can’t identify originator of Update Error MessageBy the way, when looking closer at the dev tools image (https://ibb.co/mWZsJw), I see that there’s no href value at all. Strange, isn’t it?
- This reply was modified 8 years, 7 months ago by Michael.
Forum: Fixing WordPress
In reply to: Can’t identify originator of Update Error MessageThanks, magecomp!
I’m using some paid plugins, but they all have their license keys set up. If that was the problem, then I sould see one of my plugins showing that there is an update available. But all of my components (plugins, themes, translation) are up-to-date, so there are no updates available.
I’ve tried the developer tools before, but there’s no hint. See https://ibb.co/mWZsJw.
Disabling plugins won’t help either. As far as I know, all installed plugins, no matter if they are active or disabled, are checked for updates. So I’d have to uninstall them entirely which I want to avoid.
Anyway, many thanks!
In my function.php, $EM_Event->categories didn’t work. But with a little trying, I came to this solution:
add_filter( 'body_class', 'add_event_category_to_body_class'); function add_event_category_to_body_class( $classes ) { if ( em_is_event_page() ) { global $post; $EM_Event = em_get_event($post->ID, 'post_id'); $classes[] = $EM_Event->output('#_CATEGORYSLUG'); return $classes; } }This does exactly what I asked for, except one thing: if there’s an event that has assigned more than one category, this will only output one. I think it’s always the one with the highest ID. Don’t know if that’s an error in my function or if $EM_Event->output(‘#_CATEGORYSLUG’) does only return one category.
Hi caimin,
Neither. I am on a single events page and want to detect which category (or categories) the shown event is assigned to. Then, I want the slug of that categories to be added to the body class.
Say, I’ve an event that belongs to the categories ‘Classical Music’ and ‘Concert’, then the body tag should get those added additional to its other classes. Like:
<body class="classical-music concert event-template-default single single-event postid-196429 *and-so-on...*">Forum: Plugins
In reply to: [Cr3ativ Sponsor] Shortcode: Make logo link to sponsor profile page?Thanks very much for your detailed explanation! I did it, was easy peasy indeed. 🙂
Thanks Caimin,
sorry for asking back, but I’m quite new to all of that stuff.
So you mean from my function above I should hook into the Events Manager and grab the ID of the currently displayed event? Or do I need to write a separate function?