Skip to:
Content
Pages
Categories
Search
Top
Bottom

Edit reply: how to run in the backend for keymasters immediately

  • @neon67

    Participant

    if edit the reply in full, the admin must first get to the page like /forums/reply/111111/edit/ and only then move to full editing in the backend /wp-admin/post.php?post=111111&action=edit.

    Is there a recipe for the administrator (keymaster) to be immediately transferred to the backend? The redirect can be configured using regular expressions, but then ordinary users will be without editing reply (the backend is closed).

    How can I do this using functions.php ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • @robin-w

    Moderator

    This is not fully tested, but should work

    add_filter( 'bbp_get_reply_edit_url', 'rew_admin_link', 10 , 2 ) ;
    
    function rew_admin_link ($url, $reply_id ) {
    	if ( bbp_is_user_keymaster(get_current_user_id())) { 
    	$url = '/wp-admin/post.php?post='.$reply_id.'&action=edit' ;
    	}
    return $url ;
    }

    @neon67

    Participant

    Oh, it works like a charm! This will save a lot of time for the admin.
    But all the roles need to be tested.
    I will observe for 2 weeks and report the results.
    Thanks Robin for the good Tips!

    @neon67

    Participant

    Some time has passed – release: this fix works stably, can be used to improve for admin bbtool .
    Thanks Robin.

    @robin-w

    Moderator

    Great – thanks for reporting back 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar