• Resolved swallow2603

    (@swallow2603)


    Hello team,

    I want the option to add a new icon to list icons on my theme.

    https://prntscr.com/1m6gjz8

    Please add apply_filters to be able to optionally list this icon.

    https://prntscr.com/1m6j7xx

    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)
  • Plugin Support Antonio La Rocca

    (@therock130)

    Hi there

    Sure, we’ll add it within next release of the plugin
    Just note that the filter that we will add will have this name: yith_wcwl_plugin_icons

    Thanks for the suggestion
    Marking this thread as resolved ??

    Thread Starter swallow2603

    (@swallow2603)

    Hi,

    Thank you for adding it to the next version.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add custom icon to plugin icons’ is closed to new replies.