Automattic\WooCommerce\Internal\Admin\EmailPreview
EmailPreview::get_placeholders()
Get the placeholders for the email preview.
Method of the class: EmailPreview{}
Hooks from the method
Return
Array
.
Usage
// private - for code of main (parent) class only $result = $this->get_placeholders( $email_object );
EmailPreview::get_placeholders() EmailPreview::get placeholders code WC 9.7.1
private function get_placeholders( $email_object ) { $placeholders = array(); if ( is_a( $email_object, 'WC_Order' ) ) { $placeholders['{order_date}'] = wc_format_datetime( $email_object->get_date_created() ); $placeholders['{order_number}'] = $email_object->get_order_number(); $placeholders['{order_billing_full_name}'] = $email_object->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 ); }