Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter miguelcortereal

    (@miguelcortereal)

    BTW I’m loving your plugin, nice job!

    Hi Miguel,

    Thanks for the suggestion. As this is not really a support request, may I suggest you open a feature request issue for this in the GitHub repo ?

    Smile,
    Juliette

    I agree with this request. I have classes that I want to specifically use the icons with.

    Can you show a real life example for this? Use the two class names of:

    – newClassToBeIncluded
    – otherNewClassToBeIncluded

    ******************************

    I want to change the classes used by this plugin

    You can ??

    There’s an output filter available for the attachment link classes. Mind: the $classnames_string variables holds all the classes – not just the MTLI classes – which the attachment link, i.e. the tag, has.

    To use the filter add a snippet like the following to your (child-)theme’s functions.php file:

    function my_classnameFunction( $classnames_string ) {
    // do your thing
    return $classnames_string;
    }
    add_filter( ‘mtli_classnames’, ‘my_classnameFunction’ );

    @kcwebguy I’m not sure you understand the purpose of the filter.

    The filter will *not* enable MTLI for links which it otherwise wouldn’t recognize.

    It *will* let you add classes to links MTLI has already recognized, so you can adjust/add your own styling to MTLI links.

    This will, of course, only work in non-async mode as in async mode the link recognition is done via jQuery which doesn’t run filters.

    function my_classnameFunction( $classnames_string ) {
    	return $classnames_string . ' newClassToBeIncluded otherNewClassToBeIncluded';
    }
    add_filter( 'mtli_classnames', 'my_classnameFunction' );
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add allowed classes only’ is closed to new replies.