WC_Admin_Post_Types::order_updated_messages()
Add messages when an order is updated.
Метод класса: WC_Admin_Post_Types{}
Хуков нет.
Возвращает
Массив
.
Использование
$WC_Admin_Post_Types = new WC_Admin_Post_Types(); $WC_Admin_Post_Types->order_updated_messages( $messages );
- $messages(массив) (обязательный)
- Array of messages.
Код WC_Admin_Post_Types::order_updated_messages() WC Admin Post Types::order updated messages WC 9.2.3
public function order_updated_messages( array $messages ) { global $post, $theorder; if ( ! isset( $theorder ) || ! $theorder instanceof WC_Abstract_Order ) { if ( ! isset( $post ) || 'shop_order' !== $post->post_type ) { return $messages; } else { \Automattic\WooCommerce\Utilities\OrderUtil::init_theorder_object( $post ); } } $messages['shop_order'] = array( 0 => '', // Unused. Messages start at index 1. 1 => __( 'Order updated.', 'woocommerce' ), 2 => __( 'Custom field updated.', 'woocommerce' ), 3 => __( 'Custom field deleted.', 'woocommerce' ), 4 => __( 'Order updated.', 'woocommerce' ), 5 => __( 'Revision restored.', 'woocommerce' ), 6 => __( 'Order updated.', 'woocommerce' ), 7 => __( 'Order saved.', 'woocommerce' ), 8 => __( 'Order submitted.', 'woocommerce' ), 9 => sprintf( /* translators: %s: date */ __( 'Order scheduled for: %s.', 'woocommerce' ), '<strong>' . date_i18n( __( 'M j, Y @ G:i', 'woocommerce' ), strtotime( $theorder->get_date_created() ?? $post->post_date ) ) . '</strong>' ), 10 => __( 'Order draft updated.', 'woocommerce' ), 11 => __( 'Order updated and sent.', 'woocommerce' ), ); return $messages; }