bp_core_define_slugs

Define the slug constants for the Members component.

Description

bp_core_define_slugs(); 

Handles the three slug constants used in the Members component - BP_MEMBERS_SLUG, BP_REGISTER_SLUG, and BP_ACTIVATION_SLUG. If these constants are not overridden in wp-config.php or bp-custom.php, they are defined here to match the slug of the corresponding WP pages.

In general, fallback values are only used during initial BP page creation, when no slugs have been explicitly defined.


Usage

  1. if ( !function_exists( 'bp_core_define_slugs' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-members/bp-members-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_core_define_slugs(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-members/bp-members-functions.php  
  1. function bp_core_define_slugs() { 
  2. $bp =buddypress); 
  3.  
  4. // No custom members slug. 
  5. if ( !defined( 'BP_MEMBERS_SLUG' ) ) { 
  6. if ( !empty( $bp->pages->members ) ) { 
  7. define( 'BP_MEMBERS_SLUG', $bp->pages->members->slug ); 
  8. } else { 
  9. define( 'BP_MEMBERS_SLUG', 'members' ); 
  10.  
  11. // No custom registration slug. 
  12. if ( !defined( 'BP_REGISTER_SLUG' ) ) { 
  13. if ( !empty( $bp->pages->register ) ) { 
  14. define( 'BP_REGISTER_SLUG', $bp->pages->register->slug ); 
  15. } else { 
  16. define( 'BP_REGISTER_SLUG', 'register' ); 
  17.  
  18. // No custom activation slug. 
  19. if ( !defined( 'BP_ACTIVATION_SLUG' ) ) { 
  20. if ( !empty( $bp->pages->activate ) ) { 
  21. define( 'BP_ACTIVATION_SLUG', $bp->pages->activate->slug ); 
  22. } else { 
  23. define( 'BP_ACTIVATION_SLUG', 'activate' );