bbp_get_page_by_path( string $path = '' )

Used to guess if page exists at requested path

Description

Parameters

$path

(Optional)

Default value: ''

Return

(mixed) False if no page, Page object if true

Source

File: bp-forums/common/functions.php

1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
function bbp_get_page_by_path( $path = '' ) {
 
    // Default to false
    $retval = false;
 
    // Path is not empty
    if ( !empty( $path ) ) {
 
        // Pretty permalinks are on so path might exist
        if ( get_option( 'permalink_structure' ) ) {
            $retval = get_page_by_path( $path );
        }
    }
 
    return apply_filters( 'bbp_get_page_by_path', $retval, $path );
}

Changelog

Changelog
Version Description
bbPress (r3304) 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.