bp_is_directory()

Is this a component directory page?

Description

Return

(bool) True if the current page is a component directory, otherwise false.

Source

File: bp-core/bp-core-template.php

1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
function bp_is_directory() {
    $bp     = buddypress();
    $retval = false;
 
    if ( isset( $bp->is_directory ) ) {
        $retval = $bp->is_directory;
    }
 
    /**
     * Filters whether or not user is on a component directory page.
     *
     * @since BuddyPress 2.1.0
     *
     * @param bool $retval Whether or not user is on a component directory page.
     */
    return (bool) apply_filters( 'bp_is_directory', $retval );
}

Changelog

Changelog
Version Description
BuddyPress 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.