An image, audio or a video comprises a media.

learn more… | top users | synonyms

0
votes
0answers
12 views

Auto upload images from server directory to media library

I used the code below for auto upload the images, how to check if image exists don't upload it. function WPSE_1595_image_post() { // We need to use the default uploads dir $wp_upload_dir = ...
0
votes
0answers
11 views

Massive photogallery import

I have this scenario: about 200 photo galleries to recreate in Wordpress from an old wordpress site. All I have is the .xml WXR for the post_type "photogallery" that basically creates the gallery and ...
0
votes
1answer
8 views

How to get all inline images in post content?

I want to get all inline images in the post content. The get_children() method doesn't work for me because they could add the same photo twice. Also this only gets "attached" images, and they could ...
1
vote
1answer
32 views

“Add Media” only shows “Full Size” under Attachment Display Settings

I can't seem to figure out why this dropdown is only showing "Full Size" as the option. I have the default "thumbnail", "medium", and "large" set in Settings, and I've also added a few custom sizes in ...
0
votes
1answer
15 views

wp_enqueue_media() and upload_mimes problem

Using the following code, I'm trying to allow only certain image types to be upload/selected with the WordPress media API. So I'm using add_filter on upload_mimes to restrict the mime types allowed. ...
0
votes
1answer
13 views

Extending the “Add Media”-Dialog … how do I finally insert something to the Post?

I'm developing a plugin, which extends the "add media"-Button in the Post-Editor. I found an example (I think it was nextGen Galley maybe) where wp_iframe is used in the add media dialog. For some ...
0
votes
0answers
13 views

Why can I not paste an image from the clipboard?

At some point, I remember being able to paste images from the clipboard straight into my post as I was editing. This no longer works. I just upgraded from 3.something to 4.2.2 to see if that would ...
0
votes
0answers
26 views

get_attached_media() returns empty array if media file already used by another post

I wish to retrieve the different PDF and ZIP files attached to a single post and display them in a specific section, outside the content, using the WP function get_attached_media(). While my code ...
11
votes
1answer
656 views

For what security reasons are svgs blocked in the media uploader?

I see that SVGs are blocked by default in the media uploader and you have to add it as a supported MIME type in functions.php. What security reasons are behind this?
0
votes
0answers
48 views

Disable edit media for non-admin

I am using WordPress 4.2.2 and I am the site admin. I want it so my registered users can't edit media like images. How can I hide this edit option for users (non-admins)? See yellow circled button in ...
0
votes
1answer
19 views

How to prevent intermediate images from being created but keep the sizes available for selection in the media library?

I am writing a plugin that will make use of an image service for resizing images. I want to keep the ability for users to select different image sizes, but I don't want Wordpress to create ...
0
votes
0answers
21 views

How do I create a custom add media button modal?

I've created a custom media button for the admin in editing posts, but am having trouble figuring out how to create a view for the modal. I'm not trying to insert uploaded media; I'm trying to allow ...
2
votes
2answers
48 views

Slow wp_enqueue_media()

I have developed a WordPress plugin for my site that utilises the WP Media uploader to store files... To do this my plugin contains the following code: function enqueue_scripts() { ...
0
votes
0answers
17 views

use plugin to copy media files from primary site to another network site

I have developed a plugin (specific to our network) that will copy certain posts from siteA to siteB. I can handle everything except the images which look to be specific to one site via the media ...
0
votes
0answers
12 views

Loop media by “uploaded By”?

I have a webpage that I want to display images that are uploaded by a certain author. In the backend if I look at media, each image has an 'Uploaded By' attribute, and then it says the authors name. ...
0
votes
2answers
44 views

tb_show not showing a media upload window . custom plugin

I can't figure out why the media uploader doesn't show. I'm trying to do a media upload window so the user can upload a file. The problem is, when I click on the Upload button, nothing happens, the ...
0
votes
0answers
15 views

Post comments getting added to unrelated media, not post

I'm in the process of setting up and testing a new WP install (this is my first time setting up my own WP site). With a test user I added a comment to a post. After refreshing the post page a few ...
1
vote
0answers
13 views

Add fields to the WordPress media uploader

I am trying to add an URL field to the WordPress media uploader using following code: /** * Add an URL field to gallery attachments * * @param $form_fields array, fields to include in attachment ...
2
votes
1answer
82 views

How to display all images “Uploaded By” an author

I have multiple users, that have the ability to upload media. When I look at the media library it shows the file information, and included at the bottom is an "Uploaded By 'username'" How can I use ...
0
votes
2answers
34 views

New wordpress uploads are broken

I have been running a network of WordPress sites (Multisite) since version 3.8.1. I've been constantly updating plugins and core. At some point, I discovered that uploading new images yields broken ...
0
votes
0answers
10 views

Provide New/Existing Users with Pre-Uploaded Media Images?

When a new user joins my site I want to give them the option of using pre-uploaded images. As of now, when they go to "add media" it's BLANK and they can only view files they upload. How can i ...
0
votes
0answers
14 views

Attachment Filter not displaying correctly in Media Uploader

I'm working on a plugin that uses the Media Uploader. Everything's working fine except for one little thing. When rendering the Media Uploader Modal box, it shrinks the Media Attachment Date Filter ...
0
votes
0answers
16 views

Get post attached in sequence

I'm trying to do a reader, that will take images that are attached to the post.Kinda like a comic book reader, which has a button to the next image. However only saw snippets that show to catch the ...
0
votes
0answers
20 views

Enhance-Media-Manager-For-Gallery

Enhance Media Manager for Gallery I used the example and the html template is rendering fine, however no attribute for type is added to shortcode in page content. So I believe the JS is wrong. Help? ...
0
votes
0answers
6 views

How to connect media files to links from posts?

I'm having a hard time figuring this one out. I have a website being transferred from a totally different platform. It has over 2000 posts and the hold over 10000 images. I have managed generating ...
0
votes
1answer
14 views

Edit image itself

In the back end in media library when i edit image it allows me to edit almost every thing except the image it self or the image source, so how to change the image source without changing the id of it ...
0
votes
0answers
18 views

How to toggle between playlists in Wordpress post using jquery?

I am using 4 playlists using Wordpress inbuilt audio playlists. I have 4 individual buttons to toggle between playlists. That also working. The problem with what I am facing is, the previous playlist ...
0
votes
0answers
21 views

Media Library, Files not displaying once uploaded. Recent problem

have spent past two days trying to troubleshoot problem with uploads to Media library. In fact, things are now worse than they were yesterday, when at least they were present in edit mode. Since ...
0
votes
0answers
25 views

Cropping image results in image being too small

This is the wordpress version 4.2 powell I crop 1500 x 1000 and then press on crop, then save. Resulting image size: 1497 x 1000 I don't know, I somehow hoped that wordpress is able to bloody ...
0
votes
0answers
15 views

No file when adding media directly to a post

I am working on a plugin to do some processing of uploaded images. The code below works fine when I upload an image using the media library. However, when I try to upload media directly into a post ...
1
vote
0answers
17 views

How to allow logged out users to upload media?

How do i allow non logged in users access to the media library for uploads? I am making an anonymous blog, i got posting with images to work, but i need the media button above the editor to work so ...
0
votes
0answers
10 views

Nothing works with integration mediamaneger into metaboxes

When I try to put button upload an image nothing happens. what's wrong with this? I put meta-box-image.js into my folder in my theme add_action( 'admin_enqueue_scripts', 'prfx_image_enqueue' ); ...
6
votes
2answers
179 views

How to add new tab to media upload manager with custom set of images?

I would like to add new tab to upload manager and inside list images from theme_folder/images/patterns I tried something like this to add a tab but it does not work for me since it is adding tabs ...
0
votes
0answers
9 views

Why does wp_insert_post take longer than media_handle_upload?

I've got a page on my Wordpress site where users can submit posts or documents through the front end. I use wp_insert_post for the posts, and media_handle_upload for documents. wp_insert_post takes ...
0
votes
1answer
118 views

Insert media while posting is not working with new wordpress update

Insert media while editing or adding post is not working since the 4.1.2 update. But I can upload media through media manager itself. I didn't change anything in the site today, only the automatic ...
0
votes
1answer
97 views

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

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 ...
0
votes
0answers
24 views

How to hide media link to settings?

I want disable MEDIA LINK TO settings for authors. I tried following code, but authors are still able to change settings. add_action( 'print_media_templates', function(){ echo ...
0
votes
0answers
13 views

Disable Media uploader to users

Is it possible to disable the Media uploader to anyone lower than an admin, but have the select file(s) window show?
0
votes
1answer
73 views

media sideload image not working with JPG file

media_sideload_image function not working for image url with JPG extension, its working fine for jpg (http://example.com/image.jpg) and png (http://example.com/image.png) but not with JPG ...
0
votes
0answers
20 views

Manipulating images in the media editor changes file URLs

it seems like, using the media editor to resize images, WP appends a string to the newly generated files, e.g. "...-e1428487180626.jpg". This is causing broken image links in some cases (i.e. where I ...
0
votes
0answers
56 views

wp_enqueue_media problem

I am trying to build up a form where user can request some post information including feature image. For uploading the image i have used wp_enqueue_media() which works nicely in all free themes ...
0
votes
1answer
77 views

How can I bulk delete media and attachments using WP-CLI?

I'm trying to mass delete 4000 images in a wordpress website. WP itself sets the max to 999, which would work fine and take a few minutes to delete them via the backend. However, I get REQUEST URI TOO ...
1
vote
2answers
115 views

Change WordPress' media upload URL?

This isn't the usual "How do I change the media upload folder?" question. Our entire site is run through a CDN. The CDN drops POST requests with a 5-6MB file so the WordPress uploads fail. I can work ...
0
votes
1answer
40 views

Disable image rename on upload

When I upload an image (test.jpg) with the Media manager it creates the same image with a digit after its name (test1.jpg). I disabled image cropping so files like test-[width]x[height].jpg don't ...
0
votes
0answers
20 views

Media and products does not show after adding new

Hello fellow wordpress developers, I have created a site with wordpress and woocommerce and I have a problem with the media and the products. After I enabled quick Cache (now I think it's called ...
0
votes
0answers
41 views

How to change html generated by wordpress media uploader

I have managed to change the output of wordpress media uploader using image_send_to_editor exampled below (where the output is image:($url)) However I want to do the same with other files like ...
0
votes
0answers
10 views

Triggering a task to a queue upon saving a custom post

Here's my ideal scenario for the use case I'm exploring. 1.) user creates a new custom post type record with a bunch of custom fields. One of these is a url field. 2.) upon saving the record, I'd ...
0
votes
0answers
217 views

Custom dropdown filter in media grid view

With the new grid mode in the media library the good old WP_List_Table specific restrict_manage_posts filter for adding custom filtering options is not available. All happens through JavaScript. I ...
0
votes
0answers
24 views

Get metadata of all files in the media

I need to retrieve metadata of files that are not images such as word, excel or pdf documents. I tried using get_post_meta( $post_id ); and wp_get_attachment_metadata( $attachment_id ); I'm only ...
1
vote
1answer
80 views

How to retrieve a value from an input field in a media view template

I've created a media view template with two input fields (width and height) and I was wondering how to retrieve the values entered in them in a media controller o view. PHP: function ...