Skip to:
Content

bbPress.org

Ticket #2734: 2734.5.patch

File 2734.5.patch, 5.2 KB (added by thebrandonallen, 11 years ago)

Removes all redirects on admin links

  • src/includes/admin/replies.php

    diff --git src/includes/admin/replies.php src/includes/admin/replies.php
    index 2ad892a..74b0e01 100644
    class BBP_Replies_Admin { 
    814814                if ( current_user_can( 'delete_reply', $reply->ID ) ) {
    815815                        if ( bbp_get_trash_status_id() === $reply->post_status ) {
    816816                                $post_type_object   = get_post_type_object( bbp_get_reply_post_type() );
    817                                 $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID ) ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";
     817                                $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $reply->ID ) ), 'untrash-post_' . $reply->ID ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";
    818818                        } elseif ( EMPTY_TRASH_DAYS ) {
    819                                 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $reply->ID ) ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";
     819                                $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . get_delete_post_link( $reply->ID ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";
    820820                        }
    821821
    822822                        if ( bbp_get_trash_status_id() === $reply->post_status || !EMPTY_TRASH_DAYS ) {
    823                                 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $reply->ID, '', true ) ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
     823                                $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . get_delete_post_link( $reply->ID ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
    824824                        } elseif ( bbp_get_spam_status_id() === $reply->post_status ) {
    825825                                unset( $actions['trash'] );
    826826                        }
  • src/includes/admin/topics.php

    diff --git src/includes/admin/topics.php src/includes/admin/topics.php
    index d515db0..ab699dc 100644
    class BBP_Topics_Admin { 
    967967                if ( current_user_can( 'delete_topic', $topic->ID ) ) {
    968968                        if ( bbp_get_trash_status_id() === $topic->post_status ) {
    969969                                $post_type_object   = get_post_type_object( bbp_get_topic_post_type() );
    970                                 $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . wp_nonce_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $topic->ID ) ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";
     970                                $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $topic->ID ) ), 'untrash-post_' . $topic->ID ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";
    971971                        } elseif ( EMPTY_TRASH_DAYS ) {
    972                                 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $topic->ID ) ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";
     972                                $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . get_delete_post_link( $topic->ID ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";
    973973                        }
    974974
    975975                        if ( bbp_get_trash_status_id() === $topic->post_status || !EMPTY_TRASH_DAYS ) {
    976                                 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $topic->ID, '', true ) ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
     976                                $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . get_delete_post_link( $topic->ID ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
    977977                        } elseif ( bbp_get_spam_status_id() === $topic->post_status ) {
    978978                                unset( $actions['trash'] );
    979979                        }