Skip to:
Content
Pages
Categories
Search
Top
Bottom

Changing slugs – Am I missing something?

  • @mrgiblets

    Participant

    Hey guys.

    Trying to change the title of a slug as outlined by the following pages..

    Customizable Slugs in BuddyPress

    bp-custom.php

    So I’ve put the following in my bp-custom.php :

    define ( 'BP_MEMBERS_SLUG', 'users' );

    But nothing is happening? It’s still pointing to /members in all links?

    What am I doing wrong?

Viewing 3 replies - 1 through 3 (of 3 total)
  • @danbp

    Participant

    BP_MEMBERS_SLUG is documented in bp-core-functions.php:654
    The function is declared in bp-members-template.php:22

    But you use a filter for titles. Maybe you can do something, based on this example which upercase the username on profile page title.

    function bpfr_title_apparence( $title ='', $sep = '', $seplocation = '' ) {
    	if( bp_get_displayed_user_fullname() ) {
    	$bp = buddypress();
    	
    	// Get the component's ID to try and get it's name
    	$component_id = $component_name = bp_current_component();
    	
    	// Use the actual component name
    	if ( !empty( $bp->{$component_id}->name ) ) {
    	$component_name = $bp->{$component_id}->name;
    	
    	// Fall back on the component ID (probably same as current_component)
    } elseif ( !empty( $bp->{$component_id}->id ) ) {
    	$component_name = $bp->{$component_id}->id;
    	}
    	
    	$title = str_replace( ucwords( $component_name ), '', $title );
    	}  
    	return $title;
    	}
    add_filter( 'bp_modify_page_title', 'bpfr_title_apparence', 20, 3 );

    This filter is in the same file, line 514.

    @mrgiblets

    Participant

    Sorry @danbp you’ve lost me there?

    All I’m trying to do is change the slug from “members” to “users”.

    So links become – http://www.mysite.com/users/username

    I thought the docs I was reading were outlining exactly that?

    Have I misunderstood?

    @danbp

    Participant

    WE have misunderstood together. 😀 Sorry !

    Default slug is:
    http://www.example.com/members/username

    You want:
    http://www.example.com/users/username

    Go to dashboard > pages and change the title of the member page to get it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing slugs – Am I missing something?’ is closed to new replies.
Skip to toolbar