diff --git a/assets/icons/email.svg b/assets/icons/email.svg new file mode 100644 index 0000000..01e8caa --- /dev/null +++ b/assets/icons/email.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/facebook.svg b/assets/icons/facebook.svg new file mode 100644 index 0000000..c212063 --- /dev/null +++ b/assets/icons/facebook.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/linkedin.svg b/assets/icons/linkedin.svg new file mode 100644 index 0000000..97ecb4c --- /dev/null +++ b/assets/icons/linkedin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/pinterest.svg b/assets/icons/pinterest.svg new file mode 100644 index 0000000..4947aa8 --- /dev/null +++ b/assets/icons/pinterest.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/reddit.svg b/assets/icons/reddit.svg new file mode 100644 index 0000000..3d1998e --- /dev/null +++ b/assets/icons/reddit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/whatsapp.svg b/assets/icons/whatsapp.svg new file mode 100644 index 0000000..11cef15 --- /dev/null +++ b/assets/icons/whatsapp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/x.svg b/assets/icons/x.svg new file mode 100644 index 0000000..c029599 --- /dev/null +++ b/assets/icons/x.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/projects-portfolio.php b/projects-portfolio.php index 3277b6e..3aa96ba 100644 --- a/projects-portfolio.php +++ b/projects-portfolio.php @@ -350,107 +350,51 @@ function projects_portfolio_social_sharing_buttons( $project_id ) { $html = '
'; - $svg_icon = function( string $name, string $path ) use ( &$html ) { - // Render each social icon as an with an inline SVG data URI. - // Using instead of inline ensures browser CSS sizing and - // avoids any namespace/parser quirks with inline SVG in mixed content. - $svg = '' . $path . ''; - $data_uri = 'data:image/svg+xml;utf8,' . rawurlencode( $svg ); - $html .= '' . esc_attr( $name ) . ''; -}; + $svg_icon = function( string $name, string $file ) use ( &$html ) { + // Render each social icon as an referencing a real .svg file + // shipped under assets/icons/. This bypasses any kses data: URI stripping + // and ensures the icon loads as a normal image via standard img rules. + $src = plugins_url( 'assets/icons/' . $file, __FILE__ ); + $html .= '' . esc_attr( $name ) . ''; + }; // Facebook. $html .= ''; - $svg_icon( 'Facebook', '' ); + $svg_icon( 'Facebook', 'facebook.svg' ); $html .= ''; // X (Twitter). $html .= ''; - $svg_icon( 'X', '' ); + $svg_icon( 'X', 'x.svg' ); $html .= ''; // LinkedIn. $html .= ''; - $svg_icon( 'LinkedIn', '' ); + $svg_icon( 'LinkedIn', 'linkedin.svg' ); $html .= ''; // Reddit. $html .= ''; - $svg_icon( 'Reddit', '' ); + $svg_icon( 'Reddit', 'reddit.svg' ); $html .= ''; // WhatsApp. - $html .= ''; - $svg_icon( 'WhatsApp', '' ); + $html .= ''; + $svg_icon( 'WhatsApp', 'whatsapp.svg' ); $html .= ''; // Pinterest. $html .= ''; - $svg_icon( 'Pinterest', '' ); + $svg_icon( 'Pinterest', 'pinterest.svg' ); $html .= ''; // Email. $html .= ''; - $svg_icon( 'Email', '' ); + $svg_icon( 'Email', 'email.svg' ); $html .= ''; $html .= '
'; - // wp_kses_post() strips tags by default (the 'post' context doesn't - // allow them), and would also strip data: URIs we use as a fallback. - // Extend the allowed list to keep both forms intact so the icons render. - $allowed = wp_kses_allowed_html( 'post' ); - $allowed['img'] = array( - 'src' => true, - 'alt' => true, - 'width' => true, - 'height' => true, - 'style' => true, - 'aria-hidden' => true, - ); - $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, - 'style' => 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 ); + echo wp_kses_post( $html ); } add_action( 'projects_after_download_button', 'projects_portfolio_social_sharing_buttons', 999 ); diff --git a/templates/single-projects.php b/templates/single-projects.php index 4709ff9..e8c870d 100644 --- a/templates/single-projects.php +++ b/templates/single-projects.php @@ -141,15 +141,10 @@ if ( $last_updated ) { -
- - <?php esc_attr_e( $owner_name ); ?> - + - - - +