Skip to:
Content
Pages
Categories
Search
Top
Bottom

Changing slugs with bp-custom.php: No change!

  • @jewlicious

    Participant

    I thought I wanted to do something relatively simple. I wanted to change all instances of the word “Group” to “Task Force.” I read the instructions at http://codex.buddypress.org/extending-buddypress/changing-internal-configuration-settings/ and read multiple forum posts on the subject and created a bp-custom.php file which I added to the /wp-content/plugins/buddypress and it contains the following:

    `<?php
    /* hacks and mods will go here */

    define ( ‘BP_GROUPS_SLUG’, ‘taskforces’ );

    ?>`

    So now presumably my groups directory should be http://bp.my-site.com/taskforces/ right?
    Also, any instance of the word “groups” will appear as “taskforces” instead right? (Or is that wholly dependent on the theme? I basically want the word “groups” to disappear entirely)

    Well, sadly, none of the slug alteration stuff seems to work. At all.

    I am using the latest WP 3.4.2 and BP 1.6.1 – We are hosted at MediaTemple on a linux server and this instance of BuddyPress is, as implied by the fake domain name above, a subdomain.

    I managed to alter some instances of “Groups,” changing them to “Task Forces” (with a space) by altering my theme files but the slugs? Nothin’ doin… Any idea why this is happening? Thanks!

Viewing 19 replies - 1 through 19 (of 19 total)
  • @modemlooper

    Moderator

    To change slugs you change the page name and URL for that page in the WordPress admin. To change all instances of the word you create a language file

    Languages and Translations

    @jewlicious

    Participant

    Jeepers, seriously? Changing the page name worked immediately and now I feel dumb. So what was that bp-custom.php thing all about?? What exactly is that supposed to change?

    I suppose I can follow the tutorial at https://codex.buddypress.org/extending-buddypress/customizing-labels-messages-and-urls/ for everything else. Sigh. Thanks!

    @aces

    Participant

    and bp-custom goes in /wp-content/plugins/ not /wp-content/plugins/buddypress/

    @modemlooper

    Moderator

    The BP-custom way was for older versions before BP used WP pages for directories

    @jewlicious

    Participant

    @aces : Good call. It was a typo ;)

    @modemlooper : Gah. That’s the problem when it seems that searching the support forums on buddypress.org consistently generates really poor results and so you’re forced to use Google. Gah. Thanks for the info man.

    I am now editing a zillion line .po file. Woohoo! I guess we’re done unless someone has a suggestion for better buddypress forum searches!

    @modemlooper

    Moderator

    Google search add site:buddypress.org

    @jewlicious

    Participant

    @modemlooper said 4 days, 6 hours ago:
    To change slugs you change the page name and URL for that page in the WordPress admin.

    That worked perfectly. Almost. It seems that links in the activity feed still reference “groups” as opposed to the new slug so for instance the link should be something like this:

    http://www.mysite.com/newslugforgroups/groupname/forum/topic/newforumpost/

    instead the groups slug somehow persists and reads like this:

    http://www.mysite.com/groups/groupname/forum/topic/newforumpost/

    And this above link generates a 404 page not found error.

    Old slug: groups
    New slug: newslugforgroups

    This seems to only occur in the activity feed – everywhere else, your suggestion seems to work just fine.

    @modemlooper

    Moderator

    Activity items are hard coded so links will not change to new slug. You would have to write a script to go through all activity items and switch out URL from string.

    @jewlicious

    Participant

    Wo! Thanks for the response @modemlooper

    Does that qualify as a bug? I mean on the one hand you’re allowed to alter slugs very easily but on the other hand, that will generate immediate broken links in an otherwise very important component of buddypress, namely the activity feed.

    In any case, I felt I bothered everyone enough, and the idea of creating a script is way beyond my capabilities, so what I did was revert the slug back to groups. I changed the language file as instructed and so the user sees the new name I chose to replace “groups” everywhere except for in the URL which is fine. Better that than to have 404 errors generated by the activity feed!!

    Thanks so much for your help and feedback! You too @aces !

    @modemlooper

    Moderator

    The main reason the slugs are hard coded is that having the entire activity item in one db field is speed. Though it might be just as easy to hardcore the link with php for slug output.

    If you change slug any new activity items will have correct URL. Just old items will be broken

    @djpaul

    Keymaster

    It’s something we want to change, it’s just as simple as no-one’s done it yet.

    @modemlooper

    Moderator

    @djpaul

    Is there a security issue if the the hard coded string included php

    Hardcode links as:
    `http:// /groupname`

    @djpaul

    Keymaster

    No? Only if the PHP is bad.

    @modemlooper

    Moderator

    Seems like an easy fix then. Yes?

    @tizmo

    Participant

    Dear Moderators,
    Please do/fix this in the next releases. I also wanted to change Group to something that reads in my language (though the string ‘Group’ is in .po and .mo files and translated, it is still in English on Dashboard). How great it would have been if i was easily able to change them?
    I’ve been wrestling this issue for several weeks and now trying to hire someone who can hack it and insert the translation.
    Thank you guys.

    @wadams92101

    Participant

    Was this addressed in BP 1.8.1?

    @hughshields

    Participant

    With 1.8.1 I created a new page called “Clubs” and pointed the Buddypress Groups page to it so that the URL and breadcrumb now appear as “Clubs”. So this problem is now solved.
    I would like to know the best way to change the word “Group” to “Clubs” on the rest of my site (Member Profile Tab etc). I see some very old threads that suggest using a language translation file but wanted to ask for the latest recommendations.

    @modemlooper

    Moderator

    @hughshields

    Participant

    Thanks. The localization works great and now I have changed “Groups” to “Clubs” across my site. The only thing that isn’t working is the breadcrumb for group pages. The breadcrumb displays correctly but the links are not updating to the new pages. The breadcrumb shows Home / Clubs / “individual group name” but if I click on the breadcrumb links for “Clubs” it takes me to the old Groups page. And if I click on the link for the individual group name then it takes me to what looks like a post page for the group. Any ideas how to fix this?

Viewing 19 replies - 1 through 19 (of 19 total)
  • The topic ‘Changing slugs with bp-custom.php: No change!’ is closed to new replies.
Skip to toolbar