From cc1af8ddb5a185f218c45ea3ef75655434308653 Mon Sep 17 00:00:00 2001 From: ianbelanger Date: Fri, 26 Jun 2020 14:42:02 +0000 Subject: [PATCH] Bundled Themes: Twenty Twenty Social Icons Filter. Adds a Social Icons Filter to Twenty Twenty that allows for new icons to be added to the theme by filter. Props JarretC, nielslange, acosmin, desrosj. Fixes #48713. Built from https://develop.svn.wordpress.org/trunk@48180 git-svn-id: http://core.svn.wordpress.org/trunk@47949 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../classes/class-twentytwenty-svg-icons.php | 49 ++++++++++++++++++- wp-includes/version.php | 2 +- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php b/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php index 809f7c9fc2..21a8aee89e 100644 --- a/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php +++ b/wp-content/themes/twentytwenty/classes/class-twentytwenty-svg-icons.php @@ -29,6 +29,30 @@ if ( ! class_exists( 'TwentyTwenty_SVG_Icons' ) ) { } else { $arr = array(); } + + /** + * Filters Twenty Twenty's array of icons. + * + * The dynamic portion of the hook name, `$group`, refers to + * the name of the group of icons, either "ui" or "social". + * + * @since 1.5.0 + * + * @param array $arr Array of icons. + */ + $arr = apply_filters( "twentytwenty_svg_icons_{$group}", $arr ); + + /** + * Filters an SVG icon's color. + * + * @since 1.5.0 + * + * @param array $color The icon color. + * @param array $icon The icon name. + * @param array $group The icon group. + */ + $color = apply_filters( 'twentytwenty_svg_icon_color', $color, $icon, $group ); + if ( array_key_exists( $icon, $arr ) ) { $repl = '