Skip to:
Content

BuddyPress.org

Changeset 9935


Ignore:
Timestamp:
06/11/2015 06:15:21 AM (5 years ago)
Author:
johnjamesjacoby
Message:

Members: Introduce functions for getting the Profile slug.

This change introduces two functions: bp_profile_slug() and bp_get_profile_slug() to assist in getting (and changing) the slug used by single member profiles. Note that the source of this data is the same whether XProfile is active or not.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-template.php

    r9884 r9935  
    1212// Exit if accessed directly
    1313defined( 'ABSPATH' ) || exit;
     14
     15/**
     16 * Output the profile component slug.
     17 *
     18 * @since BuddyPress (2.4.0)
     19 *
     20 * @uses bp_get_profile_slug()
     21 */
     22function bp_profile_slug() {
     23    echo bp_get_profile_slug();
     24}
     25    /**
     26     * Return the profile component slug.
     27     *
     28     * @since BuddyPress (2.4.0)
     29     *
     30     * @return string
     31     */
     32    function bp_get_profile_slug() {
     33
     34        /**
     35         * Filters the profile component slug.
     36         *
     37         * @since BuddyPress (2.4.0)
     38         *
     39         * @param string $slug Profile component slug.
     40         */
     41        return apply_filters( 'bp_get_profile_slug', buddypress()->profile->slug );
     42    }
    1443
    1544/**
Note: See TracChangeset for help on using the changeset viewer.