Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/29/2011 07:25:35 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Reply "View" action link should link to reply URL and not the permalink for the reply, since not all themes will support single reply views. Unset the "View" link if user is viewing trash and does not have proper caps.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-admin/bbp-replies.php

    r3272 r3274  
    693693            unset( $actions['inline hide-if-no-js'] );
    694694
    695             // Show view link if it's not set, the reply is trashed and the user can view trashed replies
    696             if ( empty( $actions['view'] ) && 'trash' == $reply->post_status && current_user_can( 'view_trash' ) )
    697                 $actions['view'] = '<a href="' . bbp_get_reply_permalink( $reply->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;', 'bbpress' ), bbp_get_reply_title( $reply->ID ) ) ) . '" rel="permalink">' . __( 'View', 'bbpress' ) . '</a>';
    698 
    699             bbp_reply_content( $reply->ID );
     695            // Reply view links to topic
     696            $actions['view'] = '<a href="' . bbp_get_reply_url( $reply->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;', 'bbpress' ), bbp_get_reply_title( $reply->ID ) ) ) . '" rel="permalink">' . __( 'View', 'bbpress' ) . '</a>';
     697           
     698            // User cannot view replies in trash
     699            if ( ( 'trash' == $reply->post_status ) && !current_user_can( 'view_trash' ) )
     700                unset( $actions['view'] );
    700701
    701702            // Only show the actions if the user is capable of viewing them
Note: See TracChangeset for help on using the changeset viewer.