Commit a98e69d3 authored by Kevin Stover's avatar Kevin Stover Committed by GitHub

Merge pull request #2323 from apermo/master

Update MergeTags.php
parents 25be72a7 40ccdb4f
......@@ -46,8 +46,14 @@ abstract class NF_Abstracts_MergeTags
if( ! isset($merge_tag[ 'callback' ])) continue;
$replace = ( is_callable( array( $this, $merge_tag[ 'callback' ] ) ) ) ? $this->{$merge_tag[ 'callback' ]}() : '';
if ( is_callable( array( $this, $merge_tag[ 'callback' ] ) ) ) {
$replace = $this->{$merge_tag[ 'callback' ]}();
} elseif ( is_callable( $merge_tag[ 'callback' ] ) ) {
$replace = $merge_tag[ 'callback' ]();
} else {
$replace = '';
}
$subject = str_replace( $merge_tag[ 'tag' ], $replace, $subject );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment