[buddypress-trac] [BuddyPress Trac] #4787: Defining BP_XPROFILE_SLUG throws page not found

buddypress-trac noreply at wordpress.org
Thu Jan 9 23:38:31 UTC 2020


#4787: Defining BP_XPROFILE_SLUG throws page not found
--------------------------+----------------------
 Reporter:  rogercoathup  |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Core          |     Version:  1.7
 Severity:  normal        |  Resolution:  wontfix
 Keywords:                |
--------------------------+----------------------

Comment (by raruto):

 For anyone interested here is an alternative solution (without the need to
 edit source code):

 {{{#!php
 <?php

 add_filter('bp_xprofile_slug', function($slug) { return 'custom-name'; });
 add_action( 'bp_setup_globals', 'bp_fix_custom_xprofile_slug', 10 );

 function bp_fix_custom_xprofile_slug() {
   $bp = buddypress();

   $default_component = 'custom-name';

   if ( bp_is_active( $default_component ) ) {
     $bp->default_component = $default_component;
   }

   if ( ! bp_current_component() && bp_displayed_user_id() ) {
     $bp->current_component = $default_component;
   }
 }
 }}}

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4787#comment:7>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list