Category checkboxes in upload modal
Category checkboxes in upload modal
Category checkboxes in upload modal
Custom media picker in meta box: how to select available image sizes?
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
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
@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
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
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.
sys_get_temp_dir is not a WordPress function, it’s a core PHP function. It cannot be modified or changed using WordPress constants. To modify this would require changes to the servers operating system by the root user. Instead, WP_TEMP_DIR can be used to influence the value of get_temp_dir which is a WordPress function. In the event that … Read more
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
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