Articles of media

Automatically Insert Into Post when uploading Media

When files are uploaded, I would like the, to automatically get inserted, bypassing the need to click on the “Insert into post” button I use WordPress Multisite 3.5 I tried the following, but it didn’t work. add_filter( ‘flash_uploader’, ‘_force_html_uploader’ ); function _force_html_uploader( $flash ) { remove_action(‘post-html-upload-ui’, ‘media_upload_html_bypass’ ); return false; } add_action(‘media_upload_tabs’, ‘_media_upload_auto_insert_js’); function _media_upload_auto_insert_js(){ […]

Upload images using FTP and show them in media

Hello, This weekend one of my websites was hacked and all photos was removed (the folder uploads). That means the images in my site doesn’t work. 🙁 I had a backup of that folder and I have recovered it. but the images are missing in the media from WordPress, I can not manage them and […]

How to get all inline images in post content?

This question already has an answer here: Extract image src from a post and send it to an external form 2 answers

PHP error when trying to upload .mp3 files via Media Library

When I’m trying to upload a sound file (mostly .mp3’s) via the media library, I get the following errors: Warning: require(/path/to/website/wp-includes/ID3/getid3.php): failed to open stream: No such file or directory in /path/to/website/wp-admin/includes/media.php on line 2997 Fatal error: require(): Failed opening required ‘/path/to/website/wp-includes/ID3/getid3.php’ (include_path=’.:/usr/share/php:/usr/share/pear’) in /path/to/website/wp-admin/includes/media.php on line 2997 First I thought there is a permission […]

Weird encoded error when using wp_generate_attachment_metadata()

I’m AJAX POST-ing images to WordPress from another server and using a script to upload them into the WordPress file system. I get a strange output/error for the AJAX response, which I’ve narrowed down to the line: $attach_data = wp_generate_attachment_metadata( $attach_id, $filepath); I then further narrowed down the error to this line within the wp_generate_attachment_metadata() […]

Too slow Image upload in WordPress Media Library as image number increases

we are using WordPress 4.4.2 and the WordPress Media Library for media management. We have noticed that as media (images, not videos or audio) number increases, the upload process takes too long…and the time it takes is about the same for both ie 50 kB and 6 MB images! It is not a network problem, […]

When I insert media from Library into a post, can I then safely delete that media?

My Media Library is getting cluttered and I would like to start deleting old images. Will doing so affect the posts into which I have inserted these images? Does inserting them into the post copy the images into a different folder? Can I safely delete the “original” from the Media Library?

limit media upload to once a day

Is there a way (with hook or plugin) to limit media upload to once a day per user? I can only find related articles about limit file size. Edit: The reason I want to use this is I’m setting up a social site where people share images. I’m seeing an increase in data usage and […]

Meta query for a custom taxonomy on attachment

I have a custom taxonomy “length” with 3 values [‘long’, ‘medium’, ‘short’] I have attached this taxonomy to attachments (using CPT UI) Upon viewing the taxonomy I can see that I have successfully added ‘long’ to an image as it shows “count = 1” However my query is returning no records. Array ( [post_type] => […]

Send media uploads to different directories

I am making a website for my local primary school, and I have each class page as a separate page template. Rather than have all their uploads go into the general /uploads/ folder I’d like to direct uploads to certain folders based on their page template, so that page-class1.php media uploads will always go to […]