Automattic\WooCommerce\Internal\Admin\Orders

ListTable::get_bulk_actions()protectedWC 1.0

Retrieves the list of bulk actions available for this table.

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

Хуков нет.

Возвращает

Массив.

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

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

Код ListTable::get_bulk_actions() WC 8.9.0

protected function get_bulk_actions() {
	$selected_status = $this->order_query_args['status'] ?? false;

	if ( array( 'trash' ) === $selected_status ) {
		$actions = array(
			'untrash' => __( 'Restore', 'woocommerce' ),
			'delete'  => __( 'Delete permanently', 'woocommerce' ),
		);
	} else {
		$actions = array(
			'mark_processing' => __( 'Change status to processing', 'woocommerce' ),
			'mark_on-hold'    => __( 'Change status to on-hold', 'woocommerce' ),
			'mark_completed'  => __( 'Change status to completed', 'woocommerce' ),
			'mark_cancelled'  => __( 'Change status to cancelled', 'woocommerce' ),
			'trash'           => __( 'Move to Trash', 'woocommerce' ),
		);
	}

	if ( wc_string_to_bool( get_option( 'woocommerce_allow_bulk_remove_personal_data', 'no' ) ) ) {
		$actions['remove_personal_data'] = __( 'Remove personal data', 'woocommerce' );
	}

	return $actions;
}