bbp_pre_handle_404( bool $override = false, WP_Query $wp_query = false )

Maybe handle the default 404 handling for some bbPress conditions


Description Description

Some conditions (like private/hidden forums and edits) have their own checks on bbp_template_redirect and are not currently 404s.


Parameters Parameters

$override

(Optional) Whether to override the default handler

Default value: false

$wp_query

(Optional) The posts query being referenced

Default value: false


Top ↑

Return Return

(bool) False to leave alone, true to override


Top ↑

Source Source

File: includes/common/functions.php

function bbp_pre_handle_404( $override = false, $wp_query = false ) {

	// Handle a bbPress 404 condition
	if ( isset( $wp_query->bbp_is_404 ) ) {

		// Either force a 404 when 200, or a 200 when 404
		$override = ( true === $wp_query->bbp_is_404 )
			? bbp_set_404( $wp_query )
			: bbp_set_200();
	}

	// Return, maybe overridden
	return $override;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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