Noptin_Mailer::merge( $content, $tags = array() )
Merges a string with the specified merge tags
Source Source
File: includes/class-noptin-mailer.php
public function merge( $content, $tags = array() ) { $tags = wp_parse_args( $this->get_default_merge_tags(), $tags ); // Replace all available tags with their values. foreach ( $tags as $key => $value ) { if ( ! is_array( $value ) ) { $content = str_ireplace( "[[$key]]", $value, $content ); } } // Remove unavailable tags. $content = preg_replace( '/\[\[\w+]\]/', '', $content ); return $content; }
Expand full source code Collapse full source code View on GitHub