Adding a querystring to an image URL when clicking ‘insert into post’?

You need to use the filter image_send_to_editor. add_filter(‘image_send_to_editor’, ‘wpse_62869_img_wrapper’, 20, 8); function wpse_62869_img_wrapper( $html, $id, $caption, $title, $align, $url, $size, $alt ) { return $html; } These are the values of a test insert and you can use them to build your own $html response. html | <a href=”http://wp34.dev/wp-content/uploads/2012/11/escritorio.jpg”><img src=”http://wp34.dev/wp-content/uploads/2012/11/escritorio-224×300.jpg” alt=”Alt text for the image” … Read more

Add select field to media uploader that adds a class to the image

To apply the class you need a custom function to do something with the value of your setting. To make sure the selected stays selected use the WP selected() function $form_fields[‘image-type’][‘html’] = “<select name=”attachments[{$post->ID}][profile_image_select]”>”; $form_fields[‘image-type’][‘html’] .= ‘<option ‘.selected(get_post_meta($post->ID, “_profile_image_select”, true), ‘default’,false).’ value=”‘ . $normal_image . ‘”>Normal Image</option>’; $form_fields[‘image-type’][‘html’] .= ‘<option ‘.selected(get_post_meta($post->ID, “_profile_image_select”, true), ‘default’,false).’ value=”‘ … Read more

Adding Alt Attributes Automatically when Uploading Images to Media Library

A viable solution I found was adding the post title to images missing the ALT attribute. Add the following to your functions.php file: function add_alt_tags($content) { global $post; preg_match_all(‘/<img (.*?)\/>/’, $content, $images); if(!is_null($images)) { foreach($images[1] as $index => $value) { if(!preg_match(‘/alt=/’, $value)) { $new_img = str_replace(‘<img’, ‘<img alt=”‘.$post->post_title.'”‘, $images[0][$index]); $content = str_replace($images[0][$index], $new_img, $content); } … Read more

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