How do I get allowed Media Library upload file extension list?
get_allowed_mime_types() function returns an array of mime types keyed by the file extension regex corresponding to those types.
get_allowed_mime_types() function returns an array of mime types keyed by the file extension regex corresponding to those types.
Use a plugin like Deploy Helper. Essentially, it allows you to swap out all instances of one URL with another, and will also handle serialized data. Just enter the old URL as media.detailsofmylife.net/uploads and the new one as www.detailsofmylife.net/wp-content/uploads. Make sure you also reset your custom upload paths. If you’d defined constants like WP_CONTENT_URL or … Read more
The hook for doing stuff after an upload is the reset event on wp.Uploader.queue triggered by the pluploader when it’s finished (see line 249 in “wp-includes/js/plupload/wp-plupload.js”). Here’s one hack to use this to do an auto-insert after an upload: function wpse167143_admin_footer() { ?> <script> jQuery( document ).ready(function() { typeof wp.Uploader !== ‘undefined’ && wp.Uploader.queue.on( ‘reset’, … Read more
You should check for the special characters in url, sometimes url structures may contain special characters like space, &, ‘ . use str_repalce to replace known special characters or urlencode. media_sideload_image works properly with JPG as well so either url contains special characters. If you can access image through url there is not a permission … Read more
This can be done using a front-end developer’s skills. What i achieved through the customization is as follows. Through the following code: <?php add_thickbox(); ?> <div id=”my-content-id” style=”display:none;”> <link rel=”stylesheet” href=”https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css”> <script src=”https://code.jquery.com/jquery-1.10.2.js”></script> <script src=”https://code.jquery.com/ui/1.11.4/jquery-ui.js”></script> <script> $(function() { $( “#tabs” ).tabs(); }); </script> <div id=”tabs” style=””> <ul> <li><a href=”#tabs-1″>Insert Edit/link</a></li> <li><a href=”#tabs-2″>My Second Tab</a></li> </ul> … Read more
You can get what you want via: function get_the_file_urls( ) { $query_media_urls = array( ‘post_type’ => ‘attachment’, ‘post_status’ => ‘inherit’, ‘posts_per_page’ => – 1, ); $query_urls = new WP_Query( $query_media_urls ); foreach ( $query_urls->posts as $url ) { echo ‘<ul>’ . ‘<li>’ . wp_get_attachment_url( $url->ID ) . ‘</li>’ . ‘</ul>’; } } This could either … Read more
I couldn’t find any WP specific event to hook in to. What you can do is set up an observer with a callback to respond to DOM changes using MutationObserver and check if the your featured image has been added in the callback. There’s no support in IE < 11 though, which may be a … Read more
I think you can simple use this plugin https://wordpress.org/plugins/ewww-image-optimizer/ and then try again. That should work. But solve the problem I need to know if you are using woocommerce plugin or if it is a online store website. If so then you need to adjust the image size first in the woocommerce >> Settings >> … Read more
Using my own code from here, i updated the logic to add the name of the image size instead of the suffix, try adding this to your functions.php file: add_filter(“wp_image_editors”, “my_wp_image_editors”); function my_wp_image_editors($editors) { array_unshift($editors, “WP_Image_Editor_Custom”); return $editors; } // Include the existing classes first in order to extend them. require_once ABSPATH . WPINC . … Read more
You can use a plugin called Media Library Assistant. After you install it go to your Media > Assitant (wp-admin/upload.php?page=mla-menu). Select all the images or the ones you want to edit. Click on Bulk Actions. Click on Edit and then Apply. Then you will see Uploaded on and use the date you wish.