Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/05/2020 05:06:10 PM (4 years ago)
Author:
johnjamesjacoby
Message:

Replies: fix clicking "Reply" link from the lead topic.

This commit adjusts reply.js and bbp_get_topic_reply_link() so clicking "Reply" from the lead topic now behaves similarly to clicking "Reply" from a reply. This includes support for hierarchical replies being on or off.

In trunk, for 2.7. Fixes #3385.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/topics/template.php

    r7006 r7148  
    28522852            'link_after'  => '',
    28532853            'reply_text'  => esc_html_x( 'Reply', 'verb', 'bbpress' ),
     2854            'add_below'   => 'post',
     2855            'respond_id'  => 'new-reply-' . bbp_get_topic_id(),
    28542856        ), 'get_topic_reply_link' );
    28552857
     
    28622864        }
    28632865
    2864         // Add $uri to the array, to be passed through the filter
    2865         $r['uri'] = '#new-post';
    2866         $retval   = $r['link_before'] . '<a role="button" href="' . esc_url( $r['uri'] ) . '" class="bbp-topic-reply-link">' . $r['reply_text'] . '</a>' . $r['link_after'];
     2866        // Only add onclick if replies are threaded
     2867        $onclick = bbp_thread_replies()
     2868            ? ' onclick="return addReply.cancelForm();"'
     2869            : '';
     2870
     2871        // Add $uri to the array, to be passed through the filter
     2872        $r['uri'] = remove_query_arg( array( 'bbp_reply_to', '_wpnonce' ) ) . '#new-post';
     2873        $retval   = $r['link_before'] . '<a role="button" href="' . esc_url( $r['uri'] ) . '" class="bbp-topic-reply-link"' . $onclick . '>' . $r['reply_text'] . '</a>' . $r['link_after'];
    28672874
    28682875        // Filter & return
Note: See TracChangeset for help on using the changeset viewer.