[username] shortcode in activation message
-
I needed to use the usefully provided [username] shortcode in the activation message, but it proved unavailable. The below patch should fix this:
diff --git a/wp-content/plugins/bp-registration-options/includes/core.php b/wp-content/plugins/bp-registration-options/includes/core.php index 271e1d9..5b8b4e1 100755 --- a/wp-content/plugins/bp-registration-options/includes/core.php +++ b/wp-content/plugins/bp-registration-options/includes/core.php @@ -12,12 +12,15 @@ */ function bp_registration_options_bp_after_activate_content() { $user = get_current_user_id(); + $user_info = get_userdata( $user ); + $moderate = get_option( 'bprwg_moderate' ); $activate_screen = ( false === strpos( $_SERVER['REQUEST_URI'], 'activate' ) ) ? false : true; if ( $activate_screen || bp_registration_get_moderation_status( $user ) ) { if ( $moderate ) { $activate_message = stripslashes( get_option( 'bprwg_activate_message' ) ); + $activate_message = str_replace( '[username]', $user_info->data->user_login, $activate_message ); echo '<div id="message" class="error"><p>' . $activate_message . '</p></div>'; } }ps. thanks for the otherwise useful plugin.
Viewing 4 replies - 1 through 4 (of 4 total)
-
Thanks for this. Added it to our list of enhancement issues on GitHub.
https://github.com/WebDevStudios/BuddyPress-Registration-Options/issues/149
Made sure to note that you deserve props for the change as well, so we remember to give credit.
thanks Michael, but what’s a “prop”…? ( showing my age, no doubt 😉 )
It’s basically slang for “proper credit”
Ak, I was guessing that, but you never know…
Cheers 🙂
-
This reply was modified 8 years, 8 months ago by
Richard Foley.
-
This reply was modified 8 years, 8 months ago by
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘[username] shortcode in activation message’ is closed to new replies.