WordPress.org

Forums

MimeTypes Link Icons
Add allowed classes only (6 posts)

  1. miguelcortereal
    Member
    Posted 1 year ago #

    By default the plugin looks for every links that end in an uploaded file and the exclusion of files is done by wrapping classes on those links.

    How about of also give the option to invert the way it works by making the plugin look only for the given classes at plugin settings to apply the icons?

    https://wordpress.org/plugins/mimetypes-link-icons/

  2. miguelcortereal
    Member
    Posted 1 year ago #

    BTW I'm loving your plugin, nice job!

  3. jrf
    Member
    Plugin Contributor

    Posted 1 year ago #

    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

  4. kcwebguy
    Member
    Posted 8 months ago #

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

  5. kcwebguy
    Member
    Posted 8 months ago #

    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' );

  6. jrf
    Member
    Plugin Contributor

    Posted 8 months ago #

    @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' );

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • MimeTypes Link Icons
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.