Articles of uploads

window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes

I have added two custom meta boxes to a custom post type. One is to upload an image to be stored in a custom field value for a “headshot” and the other is to upload an image to be stored in a custom field value for a “column headshot”. It’s a news site. Both send […]

List and show uploaded pdf files dynamically

I want to show all the PDFs for a specific WordPress page. I exactly want that the PDF documents will upload from the admin panel and I want to show all the PDFs in a page in the front-end dynamically. When I upload a new PDF from the admin panel, then the PDF will show […]

Rename media files generated during upload

I am trying to modify the default media names in WordPress to remove the dimensions from the files and replace them with a simple suffix. For example: imageA-300×300.jpg imageA-480×480.jpg imageA-1024×1024.jpg Would become imageA-thumb.jpg imageA-medium.jpg imageA-large.jpg How can I do this? So far, I’ve tried by adding a filter in wp_handle_upload_prefilter but it seems to only […]

Files automatically added

Today I was warned by iTheme Security that were added 2 files: wp -content / uploads / GeoIP.dat wp / content / uploads / GeoIPv6.dat Where did these come from and what is their purpose?

How to upload imagick resource to media in wordpress

$filePath = wp_get_attachment_url( $id ); $tempfilename = explode(“/”, $filePath); $temppdffile = end($tempfilename); $cuurentPath = plugin_dir_path( __FILE__ ).$temppdffile; $im = new Imagick(); $im->setResolution(300, 300); $im->readImage( $cuurentPath.'[0]’); $im->setImageFormat(‘jpg’); I have above code.. i have successsfully generated image.. $im But i have to save image to.. media in wordpress as a featured image ? Any idea.. tried every […]

wp_enqueue_media() Will not load JS on the theme

I’ve added wp_enqueue_media() to a specific page (before including the header) on my custom theme but it flat out will not any of the JS on the page. I’ve already done the basic troubleshooting: Deactivated all plugins (no go) changed themes to twenty sixteen, this time leaving all the plugins activated, and added wp_enqueue_media() function […]

Upload Image in a WordPress page using PHP

Hello awesome people of SE! 🙂 Okay, so this is a little far-fetched but I’m trying to get a HTML form with a PHP upload script to work inside a WordPress page. I can’t use a plugin. It’s supposed to be a webpage for like a designteam where customers can upload images through the html […]

programmatically create posts from files in a folder

I have a folder named ‘pdf’ (with around 1000 pdf files) in my uploads directory, i would like to create a post for each file in the folder. I am not trying to import the content from the pdf but simply create a post for each file in that folder. What i was hoping to […]

How to safely allow user upload on CPTs?

I have a form with a WP Media to allow user uploads for a custom post type on the front end. Every time I try to upload as a user I can the message You don’t have permission to attach files to this post. Investigating it further, I get denied action in the file ajax-actions.php […]

uploading files to the uploads folder via ftp

What is the reason/s that the WordPress Media Folder, doesn’t display images that were uploaded via FTP, directly to the uploads folder? Why doesn’t WordPress “see” them? why do we always have to upload via the WordPress media uploader? What does it do?