bbp_set_404( WP_Query $query = null )

Sets the 404 status.


Description Description

Used primarily with topics/replies inside hidden forums.


Parameters Parameters

$query

(Optional) The query being checked

Default value: null


Top ↑

Return Return

(bool) Always returns true


Top ↑

Source Source

File: includes/common/functions.php

function bbp_set_404( $query = null ) {

	// Global fallback
	if ( empty( $query ) ) {
		$query = bbp_get_wp_query();
	}

	// Setup environment
	$query->set_404();

	// Setup request
	status_header( 404 );
	nocache_headers();
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 bbPress (r6583) Use status_header() & nocache_headers()
2.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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