Customize Acceptable Upload File Types

February 21, 2011 | No Comments Yet

WordPress Garage points out that there’s a limited list of allowed file types that you can upload via the WP admin. For certain custom sites, since WordPress is being used for everything these days, that may need to be modified and Chris Meller shows us how.

As of WordPress 2.2, there are 35 allowed file types configured in the default install. While there’s no admin-based tool for editing this list (nor any plugins that I’m aware of), it’s not at all difficult to add your own…

The idea is to add a custom function inside your theme’s functions.php to be used as a filter. In that function you can then add specific file extensions and their corresponding mime types. On the other hand, to remove a file type that’s allowed by default, use the function unset().

Sounds simple and painless! Of course, keep in mind that limitations are put in place to keep WordPress secure, so tread carefully. Also, for reference, there’s a list of the accepted filetypes at the WordPress.com Support section, but that may vary on a self-hosted install.

Leave a Comment | Tags: , , , , , , , , ,

WordPress 2.8.6

November 13, 2009 | No Comments Yet

WordPress 2.8.6 is another important security release that tackles vulnerabilities in the Press This bookmarklet and upload file names.

The first problem is an XSS vulnerability in Press This discovered by Benjamin Flesch. The second problem, discovered by Dawid Golunski, is an issue with sanitizing uploaded file names that can be exploited in certain Apache configurations. Thanks to Benjamin and Dawid for finding and reporting these.

Upgrade now!

Leave a Comment | Tags: , , , , , , ,

Be sure to add these CSS declarations to your WordPress 2.5/2.6 stylesheets

August 20, 2008 | 1 Comment

Versions of WordPress 2.5 and 2.6 have added arbitrary new CSS classes for styling uploaded images (WP 2.5) and their captions (WP 2.6). The WordPress Codex has a page that provides CSS declarations you can add to your custom theme if you’re not too familiar with tweaking your stylesheets.


.aligncenter,
div.aligncenter {
   display: block;
   margin-left: auto;
   margin-right: auto;
}

.alignleft {
   float: left;
}

.alignright {
   float: right;
}

.wp-caption {
   border: 1px solid #ddd;
   text-align: center;
   background-color: #f3f3f3;
   padding-top: 4px;
   margin: 10px;
   /* optional rounded corners for browsers that support it */
   -moz-border-radius: 3px;
   -khtml-border-radius: 3px;
   -webkit-border-radius: 3px;
   border-radius: 3px;
}

.wp-caption img {
   margin: 0;
   padding: 0;
   border: 0 none;
}

.wp-caption p.wp-caption-text {
   font-size: 11px;
   line-height: 17px;
   padding: 0 4px 5px;
   margin: 0;
}

Also check out the links posted for more help on CSS, HTML, and WordPress blog design in general.

(Via)

Leave a Comment | Tags: , , , , , , ,