bbp_get_reply_edit_url( int $reply_id )

Return URL to the reply edit page

Description

Parameters

$reply_id

(Optional) Reply id

Return

(string) Reply edit url

Source

File: bp-forums/replies/template.php

2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
function bbp_get_reply_edit_url( $reply_id = 0 ) {
    global $wp_rewrite;
 
    $bbp   = bbpress();
    $reply = bbp_get_reply( bbp_get_reply_id( $reply_id ) );
    if ( empty( $reply ) )
        return;
 
    $reply_link = bbp_remove_view_all( bbp_get_reply_permalink( $reply_id ) );
 
    // Pretty permalinks
    if ( $wp_rewrite->using_permalinks() ) {
        $url = trailingslashit( $reply_link ) . $bbp->edit_id;
        $url = trailingslashit( $url );
 
    // Unpretty permalinks
    } else {
        $url = add_query_arg( array( bbp_get_reply_post_type() => $reply->post_name, $bbp->edit_id => '1' ), $reply_link );
    }
 
    // Maybe add view all
    $url = bbp_add_view_all( $url );
 
    return apply_filters( 'bbp_get_reply_edit_url', $url, $reply_id );
}

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.