Automattic\WooCommerce\Internal\EmailEditor\WCTransactionalEmails

WCTransactionalEmailPostsManager::delete_email_templatepublicWC 1.0

Deletes the post ID for a specific email template type.

Method of the class: WCTransactionalEmailPostsManager{}

No Hooks.

Returns

null. Nothing (null).

Usage

$WCTransactionalEmailPostsManager = new WCTransactionalEmailPostsManager();
$WCTransactionalEmailPostsManager->delete_email_template( $email_type );
$email_type(string) (required)
The type of email template e.g. 'customer_new_account' from the WC_Email->id property.

WCTransactionalEmailPostsManager::delete_email_template() code WC 10.8.1

public function delete_email_template( $email_type ) {
	$option_name = $this->get_option_name( $email_type );
	$post_id     = get_option( $option_name );

	if ( ! $post_id ) {
		return;
	}

	delete_option( $option_name );

	// Invalidate cache.
	$this->invalidate_cache_for_template( $post_id, 'post_id' );
}