bbp_check_forum_edit()

Redirect if unathorized user is attempting to edit a forum

Description

Source

File: bp-forums/forums/functions.php

function bbp_check_forum_edit() {

	// Bail if not editing a topic
	if ( !bbp_is_forum_edit() )
		return;

	// User cannot edit topic, so redirect back to reply
	if ( !current_user_can( 'edit_forum', bbp_get_forum_id() ) ) {
		wp_safe_redirect( bbp_get_forum_permalink() );
		exit();
	}
}

Changelog

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