Support » Plugin: BuddyPress Registration Options » [username] shortcode in activation message

  • Resolved Richard Foley

    (@richardfoley)


    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)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[username] shortcode in activation message’ is closed to new replies.