sd17
Forum Replies Created
-
Forum: Hacks
In reply to: Storing data from add_action and retreiving from different add_actionThanks for the response. I thought about creating a second meta value, but I’d like to avoid it since it’s very temporary and I have a large user base.
I am using a plugin that handles my user profiles (UPME). Unfortunately when I fire update_profile it doesn’t contain the new saved profile values yet. The plugin includes it’s own action upme_profile_update but there is support for $old_user_data.
You are correct in the “weird code smell”. I’m not sure why they couldn’t of used profile_update, but I’m sure there’s a reason.
From what I understand I must use $GLOBALS since I’m setting my variable inside of a function (I’m not the greatest developer if you couldn’t already tell). Using $GLOBALS[‘custom_user_meta’] works, and then I have unset it after I’m finished with it.
Why is it bad practice to use declare global vars?
Forum: Hacks
In reply to: action set_user_role missing additional rolesYou are right!
The action add_user_role worked! Thank you so much for you’re explanation.
Cheers.
Forum: Plugins
In reply to: [bbPress New Topics] Please add code from Thaddeus AidMatthias70:
I had the same issue. I’m not sure if this is right, but it works.
In the function bbp_theme_before_forum_title() add
break;at the end of foreach.foreach( $result as $row ) { if ( in_array( (int) $row->post_id, array_filter( $new_topics_array ) ) ) { echo '<span class="new-topic-notifier">' . __( 'New', 'new-topics' ) . '</span> '; break; } }