Truncating content in email notification
-
Hi. I tried my hand at creating a merge tag to truncate comment content. I clearly haven’t got it right, as it returns nothing… I wonder if you could explain where I’ve gone wrong?
$trigger->add_merge_tag( new BracketSpace\Notification\Defaults\MergeTag\StringTag( [
'slug' => 'comment_content_short',
'name' => __( 'Comment Short Content', 'textdomain' ),
'resolver' => function( $trigger ) {
$commentstuff = $trigger->{ $this->get_trigger_prop() }->comment_content;
return wp_trim_words( $commentstuff, 10, '… read on messaging page' );
},
] ) );
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Truncating content in email notification’ is closed to new replies.