Set media upload attachment link to none and hide it in WP v3.5

Include this small plugin, activate and test. A tested version in 3.6-alpha, works only on click on a thumbnail. <?php /** * Plugin Name: Remove Attachment Link-To and set to value ‘none’ */ add_action( ‘admin_footer-post-new.php’, ‘wpse_76214_script’ ); add_action( ‘admin_footer-post.php’, ‘wpse_76214_script’ ); function wpse_76214_script() { ?> <script type=”text/javascript”> jQuery(document).ready( function($) { $( ‘li.attachment’ ).live( ‘click’, function( … Read more

What is the best practice for renaming WordPress media files?

As Rarst has explained, you can’t really directly edit your database, or you’ll risk killing the serialized data. Your options are thus to: delete the file and re-upload it with its new name (obviously has the downside of having to reinsert it everywhere it was being used), or to use one of the media renaming … Read more

Differentiate Featured Image from Post Images upon Upload

You could do this by filtering the meta value for _thumbnail_id. add_filter( ‘update_post_metadata’, ‘generate_featured_image_sizes’, 10, 5 ); add_filter( ‘add_post_metadata’, ‘generate_featured_image_sizes’, 10, 5 ); function generate_featured_image_sizes( $check, $object_id, $meta_key, $meta_value, $unique_or_prev ) { if ( $meta_key == ‘_thumbnail_id’ ) { // regenerate previous featured image thumbs if it exists if ( false !== ( $prev_thumb_id = … Read more

“Add Media” only shows “Full Size” under Attachment Display Settings

In order to show new image dimension options in the WordPress admin media library you would need to use the image_size_names_choose filter to assign them a name. So the code in your functions.php should look something like this: if ( function_exists( ‘add_image_size’ ) ) { add_image_size( ‘single-post-medium’, 515 ); add_image_size( ‘single-post-small’, 250 ); } add_filter( … Read more

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