Automattic\WooCommerce\Internal\Admin\Orders
ListTable::bulk_action_notices()
Show confirmation message that order status changed for number of orders.
Метод класса: ListTable{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$ListTable = new ListTable(); $ListTable->bulk_action_notices();
Код ListTable::bulk_action_notices() ListTable::bulk action notices WC 9.3.1
public function bulk_action_notices() { if ( empty( $_REQUEST['bulk_action'] ) ) { return; } $order_statuses = wc_get_order_statuses(); $number = absint( $_REQUEST['changed'] ?? 0 ); $bulk_action = wc_clean( wp_unslash( $_REQUEST['bulk_action'] ) ); $message = ''; // Check if any status changes happened. foreach ( $order_statuses as $slug => $name ) { if ( 'marked_' . str_replace( 'wc-', '', $slug ) === $bulk_action ) { // WPCS: input var ok, CSRF ok. /* translators: %s: orders count */ $message = sprintf( _n( '%s order status changed.', '%s order statuses changed.', $number, 'woocommerce' ), number_format_i18n( $number ) ); break; } } switch ( $bulk_action ) { case 'removed_personal_data': /* translators: %s: orders count */ $message = sprintf( _n( 'Removed personal data from %s order.', 'Removed personal data from %s orders.', $number, 'woocommerce' ), number_format_i18n( $number ) ); echo '<div class="updated"><p>' . esc_html( $message ) . '</p></div>'; break; case 'trashed': /* translators: %s: orders count */ $message = sprintf( _n( '%s order moved to the Trash.', '%s orders moved to the Trash.', $number, 'woocommerce' ), number_format_i18n( $number ) ); break; case 'untrashed': /* translators: %s: orders count */ $message = sprintf( _n( '%s order restored from the Trash.', '%s orders restored from the Trash.', $number, 'woocommerce' ), number_format_i18n( $number ) ); break; case 'deleted': /* translators: %s: orders count */ $message = sprintf( _n( '%s order permanently deleted.', '%s orders permanently deleted.', $number, 'woocommerce' ), number_format_i18n( $number ) ); break; } if ( ! empty( $message ) ) { echo '<div class="updated"><p>' . esc_html( $message ) . '</p></div>'; } }