File-icon plugin hack, sorted list.

Today, i installed the WordPress File Icons Plugin (v2.0) by  Roland Rust and discovered something really annoying whilst so great at the same time.

I think the file icon plugin is a great idea, but contains 2 problems.


The first, is a client side problem. The icons css stylesheet has to be loaded each time as it is embedded into the html document (in the <head> tags) and therefore cannot be cached by your browser as your are roaming around the website.

The second, is an administration/configuration annoyance. The icons are not in any particular order and therefore finding the desired one can be a pain in the ass.

The first one would take some modification to get around, whilst the second can be easily patched.

The fix

Find the file file-icons.php which should be located in your /wp-content/plugins/file-icons/ directory.
Verify that the file is around 12Kb and the plugin is version 2.0 (so we don’t break it or encounter any problems).

Next, go to line 226. Which should look like:

foreach($iconset_cached as $file) {

Then, insert a new line before this, and the final result should look like:

sort($iconset_cached); // Sorted list hack by arkinex.com
foreach($iconset_cached as $file) {

This now makes the list sorted alphabetically, making the desired icons easier to find.
For additional help on patterns, comment on this post.

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

Thanks arkinEX for the mention! I’ll have your ideas in mind when releasing Version 2.1. rr

Leave a comment

(required)

(required)