Skip to:
Content
Pages
Categories
Search
Top
Bottom

To BP_ENABLE_USERNAME_COMPATIBILITY_MODE or Not To


  • techguy
    Participant

    @crashutah

    I’ve been researching the BP_ENABLE_USERNAME_COMPATIBILITY_MODE option in BuddyPress. I’m debating the pros and cons of using it. @DJPaul did a good job of describing what it does like this:
    if ( defined( ‘BP_ENABLE_USERNAME_COMPATIBILITY_MODE’ ) )
    $username = $user_login;
    else
    $username = $user_nicename;

    I’m interested to know if people have this turned on or off. If you have it turned on, are there issues related to using the user_nicename instead of the user_login? 90% of the time they’re probably the same, but as your site grows there’s more people that will change things. Kind of like I’ve done on this forum. My login is crashutah, but the rest are all techguy.

    So, what do you use and what issues have you found with each option?

Viewing 2 replies - 1 through 2 (of 2 total)

  • r-a-y
    Keymaster

    @r-a-y

    I’ve noticed some weird things with $user_nicename particularly on some single WP installs. For some, the user_nicename had spaces which broke member profiles.

    So I’ve had to stick to the compatibility define in some cases.

    Via the commented code in WP:
    'user_nicename' - A string that contains a nicer looking name for the user. The default is the user's username.


    Beck B
    Participant

    @beckb

    Can somebody help me with this nicenames business, too? I’m working on the username/displayname oddity I’ve already been chatting with @r-a-y about (re: the username only plugin) and have presently disabled his plugin and added this to my bp-custom.php:

    Example 1

    Well that’s lovely at various points across my site, but it doesn’t add the title info to links in, for example, the members directory. (Perhaps I should’ve more deeply investigated using your plugin as a base point, r-a-y!) So now I’m messing with the file members-loop.php, but the file bp-core-templatetags doesn’t have anything to handle whether BP_ENABLE_USERNAME_COMPATIBILITY_MODE is set, and consequently I’m not sure whether to request bp_member_user_nicename() or bp_member_user_login(). (as in: Example 2).

    Obviously, as I’m currently set up, I know that I actually need to do the nicename thing, but on a more abstract level, what should I be doing? I see there’s a filter in function bp_get_member_user_login() I might be able to monkey around with, but as it’s only passed $members_template->member->user_login, I’m not sure that’d work (or, ignorant question, is a global variable really that global?).

    I’m a bit over my head, in case that’s not already really obvious.

    Would the best solution involve disabling these nicenames, whatever exactly they are? ( @r-a-y, I see the comment you pulled out of the WP code, but it doesn’t *mean* a lot to me. In my case, I’m not actually even sure how the two got set up, since I didn’t do the initial install of WP on my site. I just know the administrator comes over as [at]admin but with a login of cltgeeks, and I’ve sussed out that admin is evidently the nicename.)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘To BP_ENABLE_USERNAME_COMPATIBILITY_MODE or Not To’ is closed to new replies.
Skip to toolbar