Skip to:
Content

bbPress.org

Changeset 5901


Ignore:
Timestamp:
08/10/2015 01:02:53 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Topics: Add edit_reply capability check to "Edit" row-action link. See #2842.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/list-tables/topic-replies.php

    r5886 r5901  
    137137   public function column_bbp_reply_content( $item = '' ) {
    138138
    139         // Start with the `edit` action
     139        // Define actions array
    140140        $actions = array(
    141             'edit' => '<a href="' . get_edit_post_link( $item->ID ) . '">' . esc_html__( 'Edit', 'bbpress' ) . '</a>',
    142141            'view' => '<a href="' . bbp_get_reply_url( $item->ID )  . '">' . esc_html__( 'View', 'bbpress' ) . '</a>'
    143142        );
     143
     144        // Prepend `edit` link
     145        if ( current_user_can( 'edit_reply', $item->ID ) ) {
     146            $actions['edit'] = '<a href="' . get_edit_post_link( $item->ID ) . '">' . esc_html__( 'Edit', 'bbpress' ) . '</a>';
     147            $actions         = array_reverse( $actions );
     148        }
    144149
    145150        // Filter the reply content
Note: See TracChangeset for help on using the changeset viewer.