bbp_set_404()

Sets the 404 status.

Description

Used primarily with topics/replies inside hidden forums.

Source

File: bp-forums/common/functions.php

1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
function bbp_set_404() {
    global $wp_query;
 
    if ( ! isset( $wp_query ) ) {
        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.', 'buddyboss' ), '3.1' );
        return false;
    }
 
    $wp_query->set_404();
}

Changelog

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