Workaround for “Add From Selection” bug in Code Snippets Plugin

I’ve found the “Add From Selection” functionality of the Code Snippets plugin has a tendency to crash Notepad++. It had been reported as an issue but does not appear to have been resolved or assigned yet, unfortunately.

The good news is, there’s a fairly trivial workaround for it in the interim. Instead of using “Add From Selection”, use the Copy command (Ctrl + C on Windows) to copy the selection into the system Clipboard, and then use the “Add From Clipboard” option instead.

How to properly modify uploadable file types in WordPress

A dark truck missing a front right tire has left gouge marks in an asphalt surface, and the shredded front right tire sits on the ground beside it.

If you work with WordPress long enough, you will upload a file that is not in WordPress’ default list of allowed file types. The file will upload, vanish suddenly, and you’ll be informed:

“Sorry, this file type is not permitted for security reasons.”

Then you’ll search Google for something like “wordpress file type not permitted for security reasons” and see several blog entries from WordPress “experts” urging you to copy and paste a code snippet that leverages the upload_mimes filter into your theme’s functions.php file.

Too bad that’s poor advice. Continue reading “How to properly modify uploadable file types in WordPress”