bp_is_blog_page()

Is this a blog page, ie a non-BP page?


Description Description

You can tell if a page is displaying BP content by whether the current_component has been defined.


Return Return

(bool) True if it's a non-BP page, false otherwise.


Top ↑

Source Source

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

function bp_is_blog_page() {

	$is_blog_page = false;

	// Generally, we can just check to see that there's no current component.
	// The one exception is single user home tabs, where $bp->current_component
	// is unset. Thus the addition of the bp_is_user() check.
	if ( ! bp_current_component() && ! bp_is_user() ) {
		$is_blog_page = true;
	}

	/**
	 * Filters whether or not current page is a blog page or not.
	 *
	 * @since 1.5.0
	 *
	 * @param bool $is_blog_page Whether or not current page is a blog page.
	 */
	return (bool) apply_filters( 'bp_is_blog_page', $is_blog_page );
}

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.