Articles of uploads

Extend the list of MIME-types supported by the builtin uploader in 3.3

Goal I want to be able to extend the list of mime-types supported by the builtin uploader in wp 3.3.1 For example when I try to upload an .apk file to our class blog, I get a Sorry, this file type is not permitted for security reasons. error. Question In 3.3 has there been any […]

how can i simple change upload folders to %year%/%month%/%day%?

Is there a easy way to do that? Godaddy have a silly limit of 1024 files in one folder and my client upload more than 500 and with the thumbnails we get lot over the limit. If im able to changed folders into %year%/%month%/%day% i will be safe about that limit Also another question is […]

How to rewrite WordPress uploads folder to another folder using htaccess

I found that the following code online could be used to spoof the WordPress uploads folder, rewriting URLs to a different folder on the server: # BEGIN Spoof wp-content/uploads directory RedirectMatch 301 ^/uploads/(.*)$ https?://yoursite.com/wp-content/uploads/$1 # END Spoof wp-content/uploads directory It is my understanding that under Media settings page the ‘Full Path to files’ needs to […]

How can I upload a file with no extension

I am trying to upload a configuration file so I can include a link to it in my post. And I get a Security error, because the file type is not allowed. My config file has no extension. I found this question: Adding file types in wordpress Is there a way that I can add […]

Where is Featured Image code stored in WP?

Well, I’m looking for source code of these two small containers (PHP backend, HTML frontend & JS used to attach the image): I want to build a theme option based on Featured Image code, but I’m not able to find it. I’m pretty sure it is somewhere in wp-admin directory, but I’ve spent loong time […]

Incremental number handling on duplicate file names

After a couple of hours searching the WP core I’ve lost hope finding this myself (for once). Could someone guide me perhaps to where WordPress handles the incremental number when having duplicate file names during uploading? As a side question. When handling questions like this, where and how would you start searching? AFAIK I’ve searched […]

Insert into Post button is missing for certain images

I thought I was crazy, but on some of the images in my media gallery, there is no “insert into post” button. see the picture: this is only for some images though, and the button is there, like it’s supposed to be, for the others. what could be causing this to afflict particular images and […]

Rename attachments during upload

Here’s the function I use for WP to rename images during upload on the fly and set the image’s filename to match the post slug. function wpsx_5505_modify_uploaded_file_names($arr) { // Get the parent post ID, if there is one if( isset($_REQUEST[‘post_id’]) ) { $post_id = $_REQUEST[‘post_id’]; } else { $post_id = false; } // Only do […]

Metabox image upload and custom field

Is it possible to a) upload image in meta box (not using default WP image uploader) and then b) get the path to uploaded this way image in a custom field?

How to move wp-content (or uploads) outside of the WordPress directory

I am trying to move the wp-content directory outside of the wordpress directory and hitting all kinds of weird problems. Even though http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content_folder says you can do this, it seems that the directory structure is deeply wired into the WP code. For example, I get error messages like: PHP message: PHP Warning: file_exists(): open_basedir restriction […]