0
votes
0answers
151 views

Rename uploads filenames to POST-ID on upload

I would like to change the way Wordpress rename uploaded files on upload. As I upload an image whose filename is "see-sunset.jpg", Wordpress will set up scaled versions and rename filenames to ...
1
vote
1answer
405 views

Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”

Good morning, I am trying to change name format that Wordpress uses to rename uploaded files. As I upload an image whose filename is "desert-landscape.jpg", Wordpress will set up scaled versions and ...
0
votes
1answer
286 views

hook into completed image upload filter

I'm trying to run a little function to determine the luminance of an image and store that in the postmeta for that image.. I have the function working, but id like it to fire when an image has ...
0
votes
1answer
237 views

Using wp_handle_upload() to direct specific path by using $overrides

How do you use wp_handle_upload function and apply_filter together to upload files on a specific path? What is going to be the override? For example: $overrides = array('file' => ...
0
votes
0answers
204 views

Pass parameter to the upload_dir filter

I'm trying to figure out a better way to pass a parameter to the function I am using with the upload_dir filter. Currently I have only gotten it to work by using sessions and/or cookie that I erase ...
0
votes
1answer
164 views

Filter causing loss of _wp_attachment_metadata

A while back I asked this question: Save camera info as metadata on image upload? Long story short, it works in that the custom field is saved into wp_postmeta and I can access that value. But as I'm ...
1
vote
0answers
206 views

Changing image URLs in media library

On a default wordpress install, the media library is located at: /wp-admin/upload.php. I am trying to update the image URL to point to my CDN, not my local server. This filter ...
0
votes
2answers
473 views

Wordpress 3.5+ upload tool filter

i would like to use the brand new wp's upload tool in a personnal theme options page. I found a lot of tutorials like : wp media uploader in plugins ...and it works very fine. But i'd like to filter ...
2
votes
0answers
159 views

How to add custom button to new media upload interface [duplicate]

I am developing a plugin and i want to add my own button to the wordpress media upload interface (WP version 3.5). Right next to the standard 'insert into page' button, i want my button to be there, ...
1
vote
1answer
528 views

Image size filtering in Media uploader according to custom post type

I have three different custom post types which require an image upload in the admin post edit page. Each type has its own image size setting. Let's say: 'news' type => picture size required: ...
2
votes
1answer
2k views

Rename image uploads with width in filename

I am attempting to change the name format that Wordpress uses to rename uploaded files. For example, when I upload an image with filename "cat-picture.jpg" Wordpress will create scaled versions and ...
0
votes
1answer
291 views

Limit upload file type on one custom post type

Is there any way to limit the filetypes allowed for upload based on the current post type? For example, I have a custom post type called documents. I have a File upload custom field which calls the ...
0
votes
1answer
631 views

Conditional add_filter for upload directory?

I have a custom media upload button (in the standard post edit page, alongside the standard media upload button), and need to change the upload directory dynamically if this button is clicked - using ...
2
votes
3answers
625 views

Filter to modify post_title after image upload?

When I upload images, Wordpress 3.4.2 sets the Title to the base of the filename, such as "DSCN1234" or "IMG_1234". I'd like the Title to be left blank. The code that sets the Title during the upload ...
3
votes
2answers
954 views

Using attachment_fields_to_edit filter inside plugin class

I'm writing a plugin using OOP. I realise that filters and action hooks need to be placed inside the constructor method in WordPress like so: add_action('wp_enqueue_scripts', array($this, ...
5
votes
1answer
323 views

Limit Media Library to Given Folder

I have made a plugin that uses the Media Library to allow users to upload files to a specific directory - using the upload_dir filter. I would like to know if there is a way (i.e. a filter) I can use ...
0
votes
1answer
170 views

Image not showing up in media loader success area - followup

This is part two to this question: Post Specific Uploader I am using an upload filter to put files in a location based on post_id. Now when the file uploads, the URL path in the meta is wrong and the ...
1
vote
1answer
145 views

Post Specific Uploader

I have played around with filters for uploading files. The closest I have gotten is to have the files uploaded to the directory, but after the file uploads, I get a series of errors: Undefined index: ...
1
vote
1answer
127 views

How to find the origin of a file upload from within wp_handle_upload?

I have a plugin that hooks into "wp_handle_upload" filter. Within that scope I'd like to be able to identify where the upload came from, meaning I want to treat it differently if it was uploaded from ...
2
votes
1answer
783 views

Can I add custom meta for each image uploaded via media-upload.php?

I'm calling media-upload.php via a custom icon click inside the content editor and I would like to add a custom meta value for all images that are uploaded when the media-upload.php is called from my ...