bbp_is_topic_edit()

Check if current page is a topic edit page

Description

Return

(bool) True if it's the topic edit page, false if not

Source

File: bp-forums/common/template.php

function bbp_is_topic_edit() {
	global $wp_query, $pagenow;

	// Assume false
	$retval = false;

	// Check query
	if ( !empty( $wp_query->bbp_is_topic_edit ) && ( $wp_query->bbp_is_topic_edit === true ) )
		$retval = true;

	elseif ( function_exists( 'bp_action_variable' ) && bp_action_variable( 0 ) == get_option( '_bbp_topic_slug', 'discussions' ) && bp_action_variable( 2 ) === bbp_get_edit_rewrite_id() )
        $retval = true;

	// Editing in admin
	elseif ( is_admin() && ( 'post.php' === $pagenow ) && ( get_post_type() === bbp_get_topic_post_type() ) && ( !empty( $_GET['action'] ) && ( 'edit' === $_GET['action'] ) ) )
		$retval = true;

	return (bool) apply_filters( 'bbp_is_topic_edit', $retval );
}

Changelog

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