diff --git a/projects-portfolio.php b/projects-portfolio.php index e4b81b3..d4f2cb8 100644 --- a/projects-portfolio.php +++ b/projects-portfolio.php @@ -387,6 +387,51 @@ function projects_portfolio_social_sharing_buttons( $project_id ) { $html .= ''; - echo wp_kses_post( $html ); + // wp_kses_post() strips by default (the 'post' context doesn't allow it). + // Extend the allowed list to keep SVG markup intact so the icons render. + $allowed = wp_kses_allowed_html( 'post' ); + $allowed['svg'] = array( + 'xmlns' => true, + 'class' => true, + 'width' => true, + 'height' => true, + 'viewBox' => true, + 'fill' => true, + 'stroke' => true, + 'stroke-width' => true, + 'stroke-linecap' => true, + 'stroke-linejoin' => true, + 'aria-hidden' => true, + 'focusable' => true, + ); + $allowed['path'] = array( + 'd' => true, + 'fill' => true, + 'stroke' => true, + ); + $allowed['rect'] = array( + 'x' => true, + 'y' => true, + 'width' => true, + 'height' => true, + 'fill' => true, + 'stroke' => true, + ); + $allowed['circle'] = array( + 'cx' => true, + 'cy' => true, + 'r' => true, + 'fill' => true, + 'stroke' => true, + ); + $allowed['line'] = array( + 'x1' => true, + 'y1' => true, + 'x2' => true, + 'y2' => true, + 'stroke' => true, + ); + + echo wp_kses( $html, $allowed ); } add_action( 'projects_after_download_button', 'projects_portfolio_social_sharing_buttons', 999 );