• erwinodendaal

    (@erwinodendaal)


    Saves time because it’s no longer necessary to manualy update to the latest version of Font Awesome. It’s convenient that users (read: clients) can add icons by themselves, but sometimes I don’t want to give them that option, or I would like to limit their choice. Unfortunately that’s not possible with this plugin. When added, I will give this plugin 5 stars.

    30-12-2014
    Mickey has provided me a simple plugin to be able to set the icons shown in the editor. Great! (And hopefully he’ll integrate it in the Better Font Awesome plugin some day…)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mickey Kay

    (@mcguive7)

    Hi there,

    I’m happy to report that you actually can filter out certain icons, using the bfa_icon_list filter that you can read more about in the documentation, here: https://github.com/MickeyKay/better-font-awesome-library#bfa_icon_list

    Hopefully this feature is worth a star to you ??

    Thread Starter erwinodendaal

    (@erwinodendaal)

    Hi Mickey,

    Thanks for the reply.
    In most cases I would only like to give users only a few icons to add. If I have to filter out all icons but 3, that’s a lot of work.
    I’d rather have the option to add icons to the edit-bar.

    Plugin Author Mickey Kay

    (@mcguive7)

    Here you go – pretty simple plugin to do just what you’re talking about:

    <?php
    /**
    * Plugin Name: Better Font Awesome Custom Icon List
    * Plugin URI:
    * Description: Filter the Better Font Awesome list to only display certain icons to the user.
    * Version: 1.0.0
    * Author: McGuive7
    * License: GPL2+
    */
    
    add_filter('bfa_icon_list', 'my_prefix_filter_icons');
    /**
     * Filter Better Font Awesome icon list to only include certain icons.
     *
     * @since   1.0.0
     *
     * @param   array  $icons  Icons to include.
     *
     * @return  array  Updated list of icons to include.
     */
    function my_prefix_filter_icons( $icons ) {
    
    	// Name of icons you want to use
    	$icons_to_show = array(
    		'adjust',
    		'car',
    	);
    
    	// Merge arrays to include icon hex value as key
    	$icons_to_show = array_intersect( $icons, $icons_to_show );
    
    	return $icons_to_show;
    
    }
    Thread Starter erwinodendaal

    (@erwinodendaal)

    Wow, that works great! Thanks.
    Have a great 2015!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Very helpfull’ is closed to new replies.