WP_List_Table批量操作无效

时间:2018-06-01 12:33:31

标签: wordpress

我正在尝试向wp管理列表表批量操作添加功能。但它没有显示任何消息。我已将$this->process_bulk_action()添加到prepare_items()

下面是我的代码

public function get_bulk_actions() {
    $actions = array(
        'delete'    => esc_html__('Delete', WP_SMART_GDPR_SLUG),
    );
    return $actions;
}

简单的流程批量操作

public function process_bulk_action(){
    if ('delete' === $this->current_action()) {
        wp_die('Items deleted (or they would be if we had items to delete)!');
    }
}

但是这不起作用而是在url &_wpnonce=88fdf22ed1&_wp_http_referer=%2Foffice%2Fwp-admin%2Fadmin.php%3Fpage%3Dwp_smart_office%26tab%3Ddelete-requests&action=delete&paged=1&request%5B0%5D=14&action2=-1

中使用这些额外的参数进入第一页

0 个答案:

没有答案