How do I modify the url of uploaded media content?

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

Insert Image automatically when upload finishes wordpress media uploader

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

media sideload image not working with JPG file

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

WordPress Built In Dialog Box For My Plugin

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

How to export a list of all media urls? [closed]

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

Rename media files generated during upload

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

How to bulk Edit Dates in Media Library?

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.