All Questions
1,114 questions with no upvoted or accepted answers
1
vote
0
answers
494
views
wp_generate_attachment_metadata is creating an empty array
I'm making a custom wp plugin for image optimization. I'm at the point that you choose the image, the script starts to optimize and put the new image in the upload folder.
The problem is that i can't ...
1
vote
0
answers
765
views
Attach Thumbnail Generated from Video Upload as Featured Image for the Video
I have a custom post type "Videos" where multiple video files can be uploaded. I need to generate a thumbnail for each of these uploaded videos and attach these thumbnails as "featured image" for the ...
1
vote
0
answers
70
views
having issue while uploading An error occured in the upload. Please try again later
First there are lots of question with this title. I have went through all but any of this not solving my issue.
I am having error while uploading image on the server
Things i have tried
upload ...
1
vote
1
answer
83
views
Enabling users to upload files
I have a page template, where users can upload images.
I use this piece of code for opening modal for media (js; only part of a code):
image_frame = wp.media({
title: 'Select Media',
multiple : '...
1
vote
1
answer
306
views
Can I change the URL of a video, or upload a video to a specific URL?
Let's say a video has been uploaded to:
https://www.example.com/wp-content/uploads/2019/08/2017-12-21_XXX.mp4
But the URL has to be:
http://www.example.com/videos/12/2017-12-21_XXX.mp4
Is there ...
1
vote
0
answers
43
views
Removing included CSS file that doesn’t exist
I tried to install a premium plugin for divi icons, But it wasn’t installed successfully.
There is a CSS file added to the homepage https://www.example.com/wp-content/uploads/aspengrove-icons/...
1
vote
1
answer
250
views
'An error occurred in the upload. Please try again later.' for users with different roles
The problem seems to be quite common, yet most of the solutions on the net are nothing to do with my issue.
So I have custom post type where on the front end users can add a post and upload an image ...
1
vote
0
answers
477
views
Why is unfiltered_upload not working despite being enabled?
According to the Codex, all that's needed to enable the unfiltered_ upload capability - i.e. the ability to upload any filetypes to the Media Library rather than just the default whitelisted ones - is ...
1
vote
0
answers
201
views
The uploaded file could not be moved to wp-content/uploads/2019/07
Uploading file at media library getting an error "The uploaded file could not be moved to wp-content/uploads/2019/07.". Please help how it resolves it.
1
vote
0
answers
147
views
Multiple media uploader buttons target only one input on the same page
I want to call the wordpress media uploader with a button in my theme options page. The thing is that I need two upload media buttons on the same page. I'm trying to do that using javascript by ...
1
vote
0
answers
383
views
(Woocommerce) How to add a custom page between cart and checkout with a file upload field per product item in the cart?
I am using Woocommerce.
I want to add a custom page in between the cart and checkout page. In this custom page, I want to show a file upload field per product item in the cart. This has to tie into ...
1
vote
2
answers
638
views
Remove upload file types filter for admin
Does anyone know if there is a function to remove/bypass file types uploads filter (specifically for admins). I know there are plugins available but they often break or don't contain ALL the mime ...
1
vote
0
answers
111
views
Add media library items to Menus using the Customizer (via Media Manager not URL)
You can add links to files in the media library URL via the Custom Links panel of the Customizer but for clients this requires multiple steps including cutting and pasting a URL from the media library ...
1
vote
0
answers
240
views
Getting gutenberg (WordPress 5) to save TInymce data?
I'm using this function to add a tinymce meta box:
add_action( 'add_meta_boxes', function(){
add_meta_box( 'test_tinymce', 'Test TinyMCE', function( $post ){
$field_value = get_post_meta(...
1
vote
0
answers
138
views
Pass additional parameter with async upload
The following image:
is showing what i want to archive. It shows the default admin upload widget in where i added a checkbox that once checked would pass an additional parameter with the async upload ...
1
vote
0
answers
144
views
Limit number of images to upload in wp.media function
I need to edit a plugin for my website. The plugin uses wp.media function and lets user upload images from the frontend.
A user should be able to upload multiple images. But, I need to set limit
on ...
1
vote
0
answers
72
views
WordPress 4.9.8 Trying to add filename over image in Media Browser
Need to add filenames of images in the media browser (not the media library, the browser when you are adding media to a post or page). I used this snippet to do that but it no longer works in ...
1
vote
1
answer
466
views
Serving a custom featured image for mobile
is it a good approach to serve multiple featured images to have a proper scaling?
Right now the featured image size on "Desktop" is up to 1140x250. Pretty wide and will shrink way too far on ...
1
vote
1
answer
53
views
Convert (-) and (escape) signs to (_) when uploading files on wordpress media library automatically
For internal purpose, I'm looking for to convert (-) and (escape) sign to (_) automatically when we upload a file (photo,video,audio) on WordPress media library.
Example:
If i try to upload this 2 ...
1
vote
0
answers
302
views
Remove anchor tag from meta box link
i've created my own metabx. You can select items (shortcodes) from my plugin und these shortcodes return html code.
How can i remove the complete a-Tag from my own meta-box content?
meta_box
...
1
vote
1
answer
2k
views
How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
I have a Custom Post Type called movies which had only title enabled from post support and 3 custom field of metabax as box office, year, and director like
now I have like 150 rows CSV formatted ...
1
vote
0
answers
64
views
Custom Post Type Video - Online/Offline
I have created a custom post type which will store posts that contain videos, i have made use of the ACF wysiwyg field to display the video content and i have a further true/false field which will ...
1
vote
0
answers
18
views
Why is the temporary upload always 4.1K
My plugin always creates uploads of 4.1KB but these movies should be actually much larger.
First I'm registering them as a shutdown function
register_shutdown_function(array($this, '...
1
vote
0
answers
607
views
Can't upload image using media_sideload_image
Have just concern about the media_sideload_image function, its does support https links image? and the wp_upload_dir() support https too?
I've tried using media_sideload_image to upload image with ...
1
vote
0
answers
16
views
Grouping metadatas into one
I want to have some custom metadatas for my custom post type. I know how to add the metadatas one by one, but I need to some of them together, considered as a single metadata.
For example lets assume ...
1
vote
0
answers
322
views
When sale price is 0.00 show only regular price
I run my woocomerce product updates via excel sheet uploads with over 10,000 products. However, with the sale price/promo price column, I have prices of 0.00, 0 and some blank.
I want a situation ...
1
vote
0
answers
700
views
wrong media url in wordpress
Having the weirdest issue in a clean Wordpress installation.
The media urls are being written with "hhttp" instead of "http".
so, for example:
http://dev.mysite.com/wp-content/uploads/...
would ...
1
vote
0
answers
38
views
Convert uploaded GIF to non animated image automatically
Is there a way to convert automatically uploaded GIF to JPEG or PNG (non animated) and keep the original?
1
vote
0
answers
869
views
wordpress media upload given An error occurred in the upload. Please try again later
i am using wordpress 4.8.3 . my website was working fine but when i moved it to another server , i saw some images of my posts are missing and when i am trying to reupload these images i faced another ...
1
vote
0
answers
62
views
Anon function and add_meta_box
I am building a WordPress management plugin (so far going really well) however I am having a slight issue below is what I am trying to acheive and the problem.
I am building a Meta manager and for ...
1
vote
0
answers
148
views
Make Wordpress compress full size image?
Regardless of size uploaded, I need Wordpress to compress the original full size image to 30% upon upload. Full size is the only image I use.
I have already disabled all thumbnail creation upon ...
1
vote
0
answers
81
views
Manipulate CSV data during upload, is it possible?
I am generating membership invoices from client supplied membership list CSV. I created a custom post type, and I'm using wpallimport to upload the CSV data into that custom post type. Each row in the ...
1
vote
0
answers
43
views
Prevent Delete Attachment by URL or When Submit
This code is working, which prevent being deleted by specific title:
add_action( 'delete_attachment', 'check_relations' );
function check_relations( $post_id ){
if(get_the_title( $post_id ...
1
vote
0
answers
108
views
Move files from flat upload directory to organised by year / month
I'm upgrading a site where there are 57,426 files in the /upload directory. I need to sort them as /upload/year/month/filename.ext because this flat non-hierarchical dir is a mess.
There's no image ...
1
vote
0
answers
326
views
Is it possible to split Default WP Media directory to multiple Folder/Subdomain?
Is it possible to split Default WP Media directory to multiple Folder/Subdomain? Coz, WP auto-generated images make sure responsive. So, I want to split media directory to separate fo Example: ...
1
vote
1
answer
32
views
After moving from complete AWS setup to a standalone Wordpress Server, Media/Image Files are Broken
Linked images on old article is pointing to:
/wp-content/uploads/YEAR/MONTH/filename.jpg
and isn't found.
Because the correct URL/Folder structure I got is:
/wp-content/uploads/YEAR/MONTH/...
1
vote
0
answers
833
views
Copying media from multisite subsites to main website
I have a multisite install -- set for using subdomains and mapped domains -- with websites from several clients on it and I would like to create a copy of each and any uploaded media file of my ...
1
vote
2
answers
914
views
Using WordPress’s add_cap method to Allow Contributors to Upload Media is not Working
I would like to allow contributors to upload media by using the following code added to functions.php. But the Add Media Button still doesn't show up.
// Allow Contributors to Add Media
if ( ...
1
vote
0
answers
145
views
Check if uploaded file has a specific filename
I want to check the uploaded file (from media library) for a specific filename during uploading time and move it in a specific directory, outside of wp-content uploads directory, replacing the old ...
1
vote
5
answers
3k
views
How do I fix "Sorry, this file type is not permitted for security reasons"
When I try to upload any PNG file, I get the following error message:
I have no plugin or anything installed, that could cause this. I even added the following line in order to fix this:
define('...
1
vote
0
answers
21
views
Submit page limited in time to upload image
I’m not sure where to ask this and where to start to search for this kind of information. Excuses in advance if this is not the right place.
I’m now the admin of a site done with Wordpress for and ...
1
vote
1
answer
173
views
Input value from metabox is not found in $_POST after post save
What I want to do is grab the input from a metabox — a number to be exact — in the post editor area and save it to a custom table I have previously created.
Here it is my code for declaring the ...
1
vote
0
answers
206
views
upload_files cap to not loggen in users - add_cap to not logged in users
When not logged in users upload files to the media endpoint, the return message is:
"Sorry, you are not allowed to create posts as this user."
I would like to allow not logged in users to be able to ...
1
vote
1
answer
371
views
Meta value does not save for scheduled posts
I created a metabox into my posts, it's a checkbox that I checked.
Here's the code for saving the data :
add_action('save_post','save_metaboxes');
function save_metaboxes($post_ID){
if (...
1
vote
1
answer
220
views
How to remove plugin metaboxes from edit.php
I want to remove some metaboxes, that was added to page edit.php by thridparty plugins. I insert this code into functions.php:
function vpm_remove_meta_box() {
remove_meta_box( 'ortext-...
1
vote
0
answers
132
views
File Upload Permissions
Introduction:
I want that a logged-in user can upload a file. Then he should be able to download that file whenever he wants to. I have finished the uploading by using wp_upload_bits - so the files ...
1
vote
0
answers
242
views
Upload multiple images to a Woocomerce product
I am trying to upload various images from an URL to a given woocomerce product. The issue I am facing with my code is that, although I see that the images are being uploaded to the server when I go to ...
1
vote
0
answers
767
views
Wordpress Media Uploader in page template (On Front-end)
I've tried to use Media Uploader in a page template, so registered users can upload some images, but I'm not sure is it possible. I know I need to include some scripts and I've called wp_enqueue_media(...
1
vote
1
answer
24
views
How can I make my metabox appear?
I'm fairly new to plugin development but have experience in coding. I've looked into several tutorials and managed to get my post type as slideshows, but I wanted to add a metabox to put an URL in.
...
1
vote
0
answers
31
views
Ho to add "Create Slider" option to default "Add Media" popup?
What are the steps to create a custom "Create Slider" option in the default "Add Media" popup (the one used to insert images and gallery into editor)? The "Create Gallery" item should be below "Create ...