Helper::add_template_tag( string $tag, string $content )

Description #

Add template tags.

Parameters #

  • $tag
    string (Required) Template tag key.
  • $content
    string (Required) Tag content.

Changelog #

VersionDescription
4.1.0Introduced.

Source #

File: addons/email/class-helper.php

	public function add_template_tag( $tag, $content ) {
		$tag = '{' . sanitize_key( $tag ) . '}';

		if ( ! isset( $this->template_tags[ $tag ] ) ) {
			$this->template_tags[ $tag ] = $content;

			/**
			 * Action triggered after adding email template tag.
			 *
			 * @since 4.1.0
			 */
			do_action_ref_array( 'ap_adding_email_tag', [ $this ] );
		}
	}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment