Skip to content

Commit

Permalink
Added a filter for the tags allowed in the feed description #722
Browse files Browse the repository at this point in the history
  • Loading branch information
zahardev committed Jul 8, 2024
1 parent 4e9153a commit 5b3a5a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion php/includes/ssp-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,8 @@ function ssp_get_the_feed_item_content( $post = null ) {
$content = preg_replace( '/<style>(.|\s)*?<\/style>/', '', $content );
$content = preg_replace( '/<script>(.|\s)*?<\/script>/', '', $content );
$content = str_replace( '<br>', PHP_EOL, $content );
$content = strip_tags( $content, '<p>,<a>,<ul>,<ol>,<li>,<strong>,<em>,<h2>,<h3>,<h4>,<h5>,<label>' );
$allowed_tags = apply_filters('ssp_feed_item_content_allowed_tags', '<p>,<a>,<ul>,<ol>,<li>,<strong>,<em>,<h2>,<h3>,<h4>,<h5>,<label>');
$content = strip_tags( $content, $allowed_tags );

// Remove empty paragraphs as well.
$content = trim( str_replace( '<p></p>', '', $content ) );
Expand Down

0 comments on commit 5b3a5a0

Please sign in to comment.