bbp_get_page_by_path( string $path = '' )

Used to guess if page exists at requested path

Description

Parameters

$path

(string) (Optional)

Default value: ''

Return

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

Source

File: bp-forums/common/functions.php

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.