Skip to:
Content

bbPress.org


Ignore:
Timestamp:
02/26/2017 06:04:52 AM (9 years ago)
Author:
johnjamesjacoby
Message:

Moderation: Maybe add view=all query-arguments to view links in row actions.

Fixes #2938.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/replies.php

    r6272 r6312  
    764764        unset( $actions['inline hide-if-no-js'] );
    765765
     766        // View link
     767        $view_link = bbp_get_reply_url( $reply->ID );
     768
     769        // Maybe add view=all
     770        if ( ! in_array( $reply->post_status, array( bbp_get_closed_status_id(), bbp_get_public_status_id() ), true ) ) {
     771            $view_link = bbp_add_view_all( $view_link, true );
     772        }
     773
    766774        // Reply view links to topic
    767         $actions['view'] = '<a href="' . esc_url( bbp_get_reply_url( $reply->ID ) ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;', 'bbpress' ), bbp_get_reply_title( $reply->ID ) ) ) . '" rel="permalink">' . esc_html__( 'View', 'bbpress' ) . '</a>';
     775        $actions['view'] = '<a href="' . esc_url( $view_link ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;', 'bbpress' ), bbp_get_reply_title( $reply->ID ) ) ) . '" rel="permalink">' . esc_html__( 'View', 'bbpress' ) . '</a>';
    768776
    769777        // User cannot view replies in trash
    770         if ( ( bbp_get_trash_status_id() === $reply->post_status ) && !current_user_can( 'view_trash' ) ) {
     778        if ( ( bbp_get_trash_status_id() === $reply->post_status ) && ! current_user_can( 'view_trash' ) ) {
    771779            unset( $actions['view'] );
    772780        }
     
    784792
    785793            // Show the 'spam' link on published and pending replies and 'not spam' on spammed replies
    786             if ( in_array( $reply->post_status, array( bbp_get_public_status_id(), bbp_get_pending_status_id(), bbp_get_spam_status_id() ) ) ) {
     794            if ( in_array( $reply->post_status, array( bbp_get_public_status_id(), bbp_get_pending_status_id(), bbp_get_spam_status_id() ), true ) ) {
    787795                $spam_uri  = wp_nonce_url( add_query_arg( array( 'reply_id' => $reply->ID, 'action' => 'bbp_toggle_reply_spam' ), remove_query_arg( array( 'bbp_reply_toggle_notice', 'reply_id', 'failed', 'super' ) ) ), 'spam-reply_'  . $reply->ID );
    788796                if ( bbp_is_reply_spam( $reply->ID ) ) {
     
    803811            }
    804812
    805             if ( bbp_get_trash_status_id() === $reply->post_status || !EMPTY_TRASH_DAYS ) {
     813            if ( bbp_get_trash_status_id() === $reply->post_status || ! EMPTY_TRASH_DAYS ) {
    806814                $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( get_delete_post_link( $reply->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
    807815            } elseif ( bbp_get_spam_status_id() === $reply->post_status ) {
Note: See TracChangeset for help on using the changeset viewer.