ActionScheduler_Abstract_ListTable::process_bulk_action()protectedWC 1.0

Checks if the current request has a bulk action. If that is the case it will validate and will execute the bulk method handler. Regardless if the action is valid or not it will redirect to the previous page removing the current arguments that makes this request a bulk action.

Метод класса: ActionScheduler_Abstract_ListTable{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->process_bulk_action();

Код ActionScheduler_Abstract_ListTable::process_bulk_action() WC 8.7.0

protected function process_bulk_action() {
	global $wpdb;
	// Detect when a bulk action is being triggered.
	$action = $this->current_action();
	if ( ! $action ) {
		return;
	}

	check_admin_referer( 'bulk-' . $this->_args['plural'] );

	$method = 'bulk_' . $action;
	if ( array_key_exists( $action, $this->bulk_actions ) && is_callable( array( $this, $method ) ) && ! empty( $_GET['ID'] ) && is_array( $_GET['ID'] ) ) {
		$ids_sql = '(' . implode( ',', array_fill( 0, count( $_GET['ID'] ), '%s' ) ) . ')';
		$id      = array_map( 'absint', $_GET['ID'] );
		$this->$method( $id, $wpdb->prepare( $ids_sql, $id ) ); //phpcs:ignore WordPress.DB.PreparedSQL
	}

	if ( isset( $_SERVER['REQUEST_URI'] ) ) {
		wp_safe_redirect(
			remove_query_arg(
				array( '_wp_http_referer', '_wpnonce', 'ID', 'action', 'action2' ),
				esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) )
			)
		);
		exit;
	}
}