Disable drag and upload in Media Library

Instead of removing upload script you can make the upload error out if the user does not have admin privileges. Like this- function tomjn_only_upload_for_admin( $file ) { if ( ! current_user_can( ‘manage_options’ ) ) { $file[‘error’] = ‘You can\’t upload images without admin privileges!’; } return $file; } add_filter( ‘wp_handle_upload_prefilter’, ‘tomjn_only_upload_for_admin’ ); For other possible … Read more

Rest API rename media

After much digging, it doesn’t seem to be possible. I did craft some automation with a Node script that basically does this: Check if the name is correct. If it’s not, then download the image, upload with a new name and update the product. If everything goes smooth, delete the original image. Same is repeated … Read more

Retrieving and Storing Images Linked from Other Domains on Local Server?

@Jan: The cache images plugin: http://blog.milandinic.com/wordpress/plugins/cache-images/ helped me with this, it does not on demand replace the links but rather goes through all links but basically does the same. One note on this: when I ran it on a small blog it worked pretty well. On another blog (http://edward.de.leau.net) it did a lot of posts … Read more

Change WordPress’ media upload URL?

It was actually easier than I thought. function route_uploads_past_cdn( $url, $path ) { $upload_paths = array( ‘async-upload.php’, ‘media-new.php’ ); if( !in_array( $path, $upload_paths ) ) { return $url; } return str_replace(‘www.’, ”, $url); } add_filter( ‘admin_url’, ‘pew_route_uploads_past_cdn’, 10, 2 ); The URL for uploading media would normally be http://www.example.com/wp-admin/media-new.php would now be http://example.com/wp-admin/media-new.php since the … Read more

How to store media files in subdomain

You can move the uploads folder to the sub domain by doing this Open up your wp-config.php file, located at the root of your WordPress installation, and add the following code: define(‘UPLOADS’, ‘http://images.mydomain.com/uploads’); The codex specifies that it should be added before the line that says require_once(ABSPATH.’wp-settings.php’);. Make sure the uploads folder is writable.

Get link of inserted media file of post within loop

You can get attachment URL like this. <?php if ( have_posts() ) : while (have_posts()) : the_post(); ?> <a href=”https://wordpress.stackexchange.com/questions/163795/<?php $featured_image_url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ),”full’ ); echo $featured_image_url[0]; ?>”> <?php the_title(); ?> </a> <?php endwhile; endif; ?> First you will need to get the attachment ID so you will need to get it from … Read more

custom image size with New Media Manager in wordpress 3.5

You will need to paste your code in order for us to review where the issue is, however, I can demonstrate how I accomplish this in WordPress v3.5 Please observe the comments in my_insert_custom_image_sizes: function my_insert_custom_image_sizes( $sizes ) { // get the custom image sizes global $_wp_additional_image_sizes; // if there are none, just return the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)