Changeset 13432 for trunk/src/bp-members/bp-members-functions.php
- Timestamp:
- 03/01/2023 08:17:11 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-functions.php
r13395 r13432 25 25 return (bool) ! empty( $bp->pages->members->id ); 26 26 } 27 28 /**29 * Define the slug constants for the Members component.30 *31 * Handles the three slug constants used in the Members component -32 * BP_MEMBERS_SLUG, BP_REGISTER_SLUG, and BP_ACTIVATION_SLUG. If these33 * constants are not overridden in wp-config.php or bp-custom.php, they are34 * defined here to match the slug of the corresponding WP pages.35 *36 * In general, fallback values are only used during initial BP page creation,37 * when no slugs have been explicitly defined.38 *39 * @since 1.5.040 */41 function bp_core_define_slugs() {42 $bp = buddypress();43 44 // No custom members slug.45 if ( !defined( 'BP_MEMBERS_SLUG' ) ) {46 if ( !empty( $bp->pages->members ) ) {47 define( 'BP_MEMBERS_SLUG', $bp->pages->members->slug );48 } else {49 define( 'BP_MEMBERS_SLUG', 'members' );50 }51 }52 53 // No custom registration slug.54 if ( !defined( 'BP_REGISTER_SLUG' ) ) {55 if ( !empty( $bp->pages->register ) ) {56 define( 'BP_REGISTER_SLUG', $bp->pages->register->slug );57 } else {58 define( 'BP_REGISTER_SLUG', 'register' );59 }60 }61 62 // No custom activation slug.63 if ( !defined( 'BP_ACTIVATION_SLUG' ) ) {64 if ( !empty( $bp->pages->activate ) ) {65 define( 'BP_ACTIVATION_SLUG', $bp->pages->activate->slug );66 } else {67 define( 'BP_ACTIVATION_SLUG', 'activate' );68 }69 }70 }71 add_action( 'bp_setup_globals', 'bp_core_define_slugs', 11 );72 27 73 28 /** … … 1548 1503 ); 1549 1504 1550 // Core constants.1505 // @todo replace slug constants with custom slugs. 1551 1506 $slug_constants = array( 1552 'BP_GROUPS_SLUG',1553 'BP_MEMBERS_SLUG',1554 1507 'BP_FORUMS_SLUG', 1555 'BP_BLOGS_SLUG',1556 'BP_ACTIVITY_SLUG',1557 'BP_XPROFILE_SLUG',1558 'BP_FRIENDS_SLUG',1559 1508 'BP_SEARCH_SLUG', 1560 'BP_SETTINGS_SLUG',1561 'BP_NOTIFICATIONS_SLUG',1562 'BP_REGISTER_SLUG',1563 'BP_ACTIVATION_SLUG',1564 1509 ); 1565 1510 foreach ( $slug_constants as $constant ) {
Note: See TracChangeset
for help on using the changeset viewer.