Automattic\WooCommerce\Internal\Admin\EmailPreview
EmailPreview::get_placeholders()
Get the placeholders for the email preview.
Метод класса: EmailPreview{}
Хуки из метода
Возвращает
Массив
.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_placeholders( $order );
- $order(WC_Order) (обязательный)
- The order object.
Код EmailPreview::get_placeholders() EmailPreview::get placeholders WC 9.6.1
private function get_placeholders( $order ) { $placeholders = array(); if ( is_a( $order, 'WC_Order' ) ) { $placeholders['{order_date}'] = wc_format_datetime( $order->get_date_created() ); $placeholders['{order_number}'] = $order->get_order_number(); $placeholders['{order_billing_full_name}'] = $order->get_formatted_billing_full_name(); } /** * Placeholders for email preview. * * @param WC_Order $placeholders Placeholders for email subject. * @param string $email_type The email type to preview. * * @since 9.6.0 */ return apply_filters( 'woocommerce_email_preview_placeholders', $placeholders, $this->email_type ); }