Last active
March 24, 2021 06:42
-
-
Save jakubmikita/12660b4255d38b6a8a43dd0a8cb644c9 to your computer and use it in GitHub Desktop.
[Notification] Stripping HTML from Post Content Merge Tag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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