我正在尝试向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