Skip to:
Content
Pages
Categories
Search
Top
Bottom

edit answer in forum not work


  • jlemee
    Participant

    @jlemee

    bbp_get_topic_edit_link work but bbp_get_reply_edit_link not work, my page is blank, can you help me please ? (bbp_get_reply_to_link(), bbp_get_topic_edit_link() and bbp_get_reply_trash_link() works perfectly)

    // change admin links displayed
    add_filter ('bbp_reply_admin_links', 'change_admin_links' ) ;
    
    function change_admin_links ($r) {
        $r['links'] = apply_filters( 'rw_reply_admin_links', array(
                        'reply'  => bbp_get_reply_to_link ( $r ),
                        // 'edit'   => bbp_get_topic_edit_link ( $r ),
                        'edit'   => bbp_get_reply_edit_link ( $r ),
                        'trash'  => bbp_get_reply_trash_link ( $r ),
    
                    ), $r['id'] );
        return $r['links'] ;
    }

    thanks for your help

Viewing 12 replies - 1 through 12 (of 12 total)

  • Robin W
    Moderator

    @robin-w

    where did this code come from?


    jlemee
    Participant

    @jlemee

    I found it on a bbpress support discussion because I only wanted you to keep the modify, edit and trash links. But the link to edit never worked, before or after adding this code


    Robin W
    Moderator

    @robin-w

    try

    add_filter ('bbp_get_reply_admin_links', 'change_admin_links' ) ;


    Robin W
    Moderator

    @robin-w

    correction, that will not wok


    Robin W
    Moderator

    @robin-w

    so this should work, but looks like your function

    // change admin links displayed
    add_filter ('bbp_reply_admin_links', 'change_admin_links' ) ;
    
    function change_admin_links ($r) {
        $r['links'] = apply_filters( 'rw_reply_admin_links', array(
                    'edit'    => bbp_get_reply_edit_link   ( $r ),
    				//'move'    => bbp_get_reply_move_link   ( $r ),
    				//'split'   => bbp_get_topic_split_link  ( $r ),
    				'trash'   => bbp_get_reply_trash_link  ( $r ),
    				//'spam'    => bbp_get_reply_spam_link   ( $r ),
    				//'approve' => bbp_get_reply_approve_link( $r ),
    				'reply'   => bbp_get_reply_to_link     ( $r )
    
                    ), $r['id'] );
    return $r['links'] ;
    }

    jlemee
    Participant

    @jlemee

    I don’t understand why it’s not work.
    I have a function for topic links and function for answer (reply) links

    // change answer links displayed
    add_filter ('bbp_reply_admin_links', 'change_admin_links' ) ;
    
    function change_admin_links ($r) {
        $r['links'] = apply_filters( 'rw_reply_admin_links', array(
                        'reply'  => bbp_get_reply_to_link ( $r ),
                        // 'edit'   => bbp_get_topic_edit_link ( $r ),
                        'edit'   => bbp_get_reply_edit_link ( $r ),
                        'trash'  => bbp_get_reply_trash_link ( $r ),
    
                    ), $r['id'] );
        return $r['links'] ;
    }
    
    //change topic links displayed
    add_filter ('bbp_topic_admin_links', 'change_topic_admin_links' ) ;
    function change_topic_admin_links ($r) {
        $r['links'] = apply_filters( 'rw_topic_admin_links', array(
                        'reply'  => bbp_get_topic_reply_link ( $r ),
                        // 'edit'   => bbp_get_topic_edit_link ( $r ),
                        'edit'   => bbp_get_topic_edit_link ( $r ),
                        'trash'  => bbp_get_topic_trash_link ( $r ),
    
                    ), $r['id'] );
        return $r['links'] ;
    }

    Robin W
    Moderator

    @robin-w

    I can only suggest you enable debug and see if this throws up an error


    jlemee
    Participant

    @jlemee

    I don’t have any errors, but in the debug log, I see:

    PHP Deprecated: Creation of dynamic property BBP_Forums_Component::$members
    PHP Deprecated: Creation of dynamic property BBP_Forums_Component::$activity

    However, I don’t think these are causing the problem. Only the bbp_get_reply_edit_link() function is not working, and I don’t understand why. Do you have any ideas, please?


    Robin W
    Moderator

    @robin-w

    Ok do the users have permission to edit replies


    Robin W
    Moderator

    @robin-w

    Ok do the users have permission to edit replies


    jlemee
    Participant

    @jlemee

    I don’t know, where can I verify this information please ?


    Robin W
    Moderator

    @robin-w

    I’m on holiday but from memory
    Dashboard settings forums and there is a setting for how many minutes users can edit responses and set it to a large number

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