Home / Admin / Alter Payment List Quick Actions
Duplicate Snippet

Embed Snippet on Your Site

Alter Payment List Quick Actions

Remove the 'Delete' option from the Payment List Quick Action

Code Preview
php
<?php
/* Remove the 'Delete' option from the Payment List Quick Action
 * This can require a fine tuning of the user roles, typically handeled in a plugin
 * Example: http://wordpress.org/plugins/user-role-editor/
 *
 * Source of snippet: https://easydigitaldownloads.com/support/topic/custom-payment-history-view-per-user-role/
 */
function ck_edd_remove_order_trash_action( $row_actions, $order ) {
    if ( ! current_user_can( 'delete_shop_payment' ) ) {
        unset( $row_actions['trash'] );
    }
    return $row_actions;
}
add_filter( 'edd_order_row_actions', 'ck_edd_remove_order_trash_action', 10, 2 );

Comments

Add a Comment