• Resolved nick1900

    (@nick1900)


    Hi

    This has been easy to implement – I’m using it with WP Symposium as the site needs a small community of users to maintain a profile/post to a forum etc.

    What I don’t understand is that when signing up the activated user link defaults to an author rather than a subscriber so doesn’t work when clicked. Is there a way to adjust this? The user appears to be able to update their custom profile ok.

    Thanks

    https://wordpress.org/plugins/profile-builder/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Cristian Antohe

    (@sareiodata)

    Hi,

    Do you have a link to the site so I can have a look?

    > the activated user link defaults to an author rather than a subscriber
    Isn’t that link managed by the theme? Maybe it isn’t querying it correctly.

    Thread Starter nick1900

    (@nick1900)

    Thanks for the response.

    It’s this site (the url is a temp alias until the build is complete).

    If you register the issue is with the user link for logged in status field that appears:

    “You are logged in as XXX. You don’t need another account. Logout »”

    Appreciate any feedback.

    Plugin Author Cristian Antohe

    (@sareiodata)

    Hi Nick,

    That’s actually the correct functionality.

    The link http://3rdcarabiniers.org.uk.gridhosted.co.uk/author/sareiodata_test/ (in my case) is the ARCHIVE page for this user. In WordPress, ALL users get an automatic archive page. Since I don’t have any posts, I get a 404 error / not found.

    Now, you can remove that link using a bit of custom code:
    – download the empty customization plugin: http://www.cozmoslabs.com/docs/profile-builder-documentation/developer-docs/#Customizing_Profile_Builder
    – add this code to it to remove the link:

    add_filter('wppb_register_have_account_alert', 'wppb_custom_register_notice', 10, 2);
    function wppb_custom_register_notice( $message, $login_id){
    	$user = get_user_by( 'id', $login_id );
    	$user_name = $user->user_login;
    	$logout_url = wp_logout_url( get_permalink() );
    	return "You are already logged in as {$user_name}. You do not need another account. <a href='{$logout_url}'>Logout</a>";
    }

    Hope this helps.

    Thread Starter nick1900

    (@nick1900)

    Thanks for the fix. I added the code to the blank plugin and uploaded to the correct folder but on activation it’s saying there is something wrong with line 3:

    Parse error: syntax error, unexpected T_FUNCTION in /var/sites/3/3rdcarabiniers.org.uk/public_html/wp-content/plugins/profile-builder-customizations/index.php on line 3

    Plugin Author Cristian Antohe

    (@sareiodata)

    Try and replace everything inside index.php with this:

    <?php
    /*
    Plugin Name: Profile Builder Custom Registration Alert
    Plugin URI:
    Description:
    Version: 1
    Author: Reflection Media, Cristian Antohe
    Author URI: http://www.reflectionmedia.ro
    License: GPL2
    */
    
    add_filter('wppb_register_have_account_alert', 'wppb_custom_register_notice', 10, 2);
    function wppb_custom_register_notice( $message, $login_id){
    	$user = get_user_by( 'id', $login_id );
    	$user_name = $user->user_login;
    	$logout_url = wp_logout_url( get_permalink() );
    	return "You are already logged in as {$user_name}. You do not need another account. <a href='{$logout_url}'>Logout</a>";
    }

    Let me know if it works.

    Thread Starter nick1900

    (@nick1900)

    Hi

    I added the new code and activated the plugin – all ok now. But it hasn’t changed anything – the link is still active to the author page for the user.

    It will be really confusing for these users who are all 70+ Army veterans. Sorry for the additional work!

    Plugin Author Cristian Antohe

    (@sareiodata)

    Are you sure it’s activated? Just tested it and it works ok.

    Thread Starter nick1900

    (@nick1900)

    Yes it’s activated…

    Not sure what the issue is, I’ve set up membership sites recently (with 250+ users) and haven’t had the issue with the user archive page, it’s always simply linked back to the profile.

    Plugin Author Cristian Antohe

    (@sareiodata)

    Just logged in and navigated here: http://3rdcarabiniers.org.uk.gridhosted.co.uk/register/ and it worked. The text on the registration page (for subscribers) is:

    “You are already logged in as sareiodata_test. You do not need another account. Logout”

    There is no link to the archive page of the user.

    Perhaps we’re talking about two different things? Can you tell what you did, what happened and what you were expecting it to happen?

    Also, if you’re an administrator, you’ll still see the registration page, because admins can register users them self.

    Thread Starter nick1900

    (@nick1900)

    apologies, it looks like you killed the link for the register page when logged in so I assumed it would then be global setting. I was looking at the homepage login but the link is still active in that area.

    I always use an alternate browser to check from a users’ perspective.

    Plugin Author Cristian Antohe

    (@sareiodata)

    Got it. Try out this code. Added a filter to that area also.

    <?php
    /*
    Plugin Name: Profile Builder Custom Registration Alert
    Plugin URI:
    Description:
    Version: 1
    Author: Reflection Media, Cristian Antohe
    Author URI: http://www.reflectionmedia.ro
    License: GPL2
    */
    
    add_filter('wppb_register_have_account_alert', 'wppb_custom_register_notice', 10, 2);
    function wppb_custom_register_notice( $message, $login_id){
    	$user = get_user_by( 'id', $login_id );
    	$user_name = $user->user_login;
    	$logout_url = wp_logout_url( get_permalink() );
    	return "You are already logged in as {$user_name}. You do not need another account. <a href='{$logout_url}'>Logout</a>";
    }
    
    add_filter('wppb_login_login_message1', 'wppb_custom_login_notice', 10, 2);
    function wppb_custom_login_notice( $message, $login_id){
    	$user = get_user_by( 'id', $login_id );
    	$user_name = $user->user_login;
    	$logout_url = wp_logout_url( get_permalink() );
    	return "You are logged in as {$user_name}. <a href='{$logout_url}'>Logout</a>";
    }
    Thread Starter nick1900

    (@nick1900)

    Great thanks, that did it. Thanks for the help.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘New user has a dead author link, how to change this?’ is closed to new replies.