Skip to content

Instantly share code, notes, and snippets.

@jakubmikita
Last active March 24, 2021 06:42
Show Gist options
  • Save jakubmikita/12660b4255d38b6a8a43dd0a8cb644c9 to your computer and use it in GitHub Desktop.
Save jakubmikita/12660b4255d38b6a8a43dd0a8cb644c9 to your computer and use it in GitHub Desktop.
[Notification] Stripping HTML from Post Content Merge Tag
<?php
use BracketSpace\Notification\Defaults\MergeTag\Post\PostContent;
use BracketSpace\Notification\Defaults\MergeTag\Post\PostContentHtml;
add_filter( 'notification/merge_tag/value/resolved', function( $resolved, $merge_tag ) {
if ( $merge_tag instanceof PostContent || $merge_tag instanceof PostContentHtml ) {
$resolved = strip_tags( $resolved );
}
return $resolved;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment