bbp_check_reply_edit()

Redirect if unathorized user is attempting to edit a reply

Description

Source

File: bp-forums/replies/functions.php

2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
function bbp_check_reply_edit() {
 
    // Bail if not editing a topic
    if ( !bbp_is_reply_edit() )
        return;
 
    // User cannot edit topic, so redirect back to reply
    if ( !current_user_can( 'edit_reply', bbp_get_reply_id() ) ) {
        wp_safe_redirect( bbp_get_reply_url() );
        exit();
    }
}

Changelog

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