From 48d751fe513fc03395237c6e2a52f353384c4bd5 Mon Sep 17 00:00:00 2001 From: Yann Kozon Date: Tue, 25 Oct 2022 11:29:09 +0200 Subject: [PATCH] Add filter to custom service icon --- packages/block-library/src/social-link/index.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/social-link/index.php b/packages/block-library/src/social-link/index.php index 3aabd2a9a8430..3a1c4eb1b4b24 100644 --- a/packages/block-library/src/social-link/index.php +++ b/packages/block-library/src/social-link/index.php @@ -48,7 +48,18 @@ function render_block_core_social_link( $attributes, $content, $block ) { $rel_target_attributes = 'rel="noopener nofollow" target="_blank"'; } - $icon = block_core_social_link_get_icon( $service ); + $icon = block_core_social_link_get_icon( $service ); + + /** + * Filters the social icon to custom icon + * + * @param string $icon SVG Element for service icon. + * @param string $service The service icon. + * + * @return string SVG Element for service icon. + */ + $icon = apply_filters( 'block_social_link_icon', $icon, $service ); + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => 'wp-social-link wp-social-link-' . $service,