How to add custom icon to plugin icons
-
Hello team,
I want the option to add a new icon to list icons on my theme.
Please add apply_filters to be able to optionally list this icon.
if ( ! function_exists( 'yith_wcwl_get_plugin_icons' ) ) { /** * Return array of available icons * * @param string $none_label Label to use for none option. * @param string $custom_label Label to use for custom option. * * @return array Array of available icons, in class => name format */ function yith_wcwl_get_plugin_icons( $none_label = '', $custom_label = '' ) { $icons = json_decode( file_get_contents( YITH_WCWL_DIR . 'assets/js/admin/yith-wcwl-icons.json' ), true ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents $icons['none'] = $none_label ? $none_label : __( 'None', 'yith-woocommerce-wishlist' ); $icons['custom'] = $custom_label ? $custom_label : __( 'Custom', 'yith-woocommerce-wishlist' ); return apply_filters( 'yith_wcwl_get_list_icons', $icons ) ; } }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to add custom icon to plugin icons’ is closed to new replies.