0
votes
0answers
12 views

Modify images when inserted in to WYSWYG Editor

When an image get added it currently adds <a href="www.domain.com/image.jpg"><img src="www.domain.com/image.jpg" /></a> I am aware that user can directly add the link. However the ...
0
votes
0answers
34 views

Removing image dimensions from `the_content`

I'm looking to remove image dimensions from the_post_thumbnail, as well as the_content. I've found the following code, but there's a slight issue: add_filter( 'post_thumbnail_html', ...
1
vote
0answers
45 views

Add custom text in the media library image meta area

I want to add some custom text in this area in the media library: Is there a filter I could hook into or how can I add content there? If not, how do we do this using Javascript? I want the text to ...
0
votes
0answers
126 views

Rename uploads filenames to POST-ID on upload

I would like to change the way Wordpress rename uploaded files on upload. As I upload an image whose filename is "see-sunset.jpg", Wordpress will set up scaled versions and rename filenames to ...
1
vote
1answer
227 views

Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”

Good morning, I am trying to change name format that Wordpress uses to rename uploaded files. As I upload an image whose filename is "desert-landscape.jpg", Wordpress will set up scaled versions and ...
0
votes
1answer
135 views

hook into completed image upload filter

I'm trying to run a little function to determine the luminance of an image and store that in the postmeta for that image.. I have the function working, but id like it to fire when an image has ...
0
votes
1answer
407 views

How can I change the <img src> to <data-original> for lazyload wp smilies

I tried to improve my WordPress performance, and already put the content <img> with jQuery LazyLoad. Now, I got some problem in changing the smilies src, already set the theme smilies add ...
1
vote
0answers
101 views

Conditional Image Sizes for Use via Theme Customizer Upload Only

I'm looking for a way to add image sizes that are only generated by uploads happening in the Theme Customizer, any suggestions or direction on how this could be done? I've already worked with the ...
2
votes
1answer
366 views

Hide custom image sizes from media library

I want to hide a few custom image sizes from the media uploader: The following code (posted here) works only for the default image sizes: function remove_image_sizes($sizes) { ...
0
votes
1answer
202 views

How can I use wp_save_image_editor_file filter?

I would like to use wp_save_image_editor_file filter, but there is no documentation on the internet. Also, it seems that no matter how many arguments I pass to the handler, all are null.
2
votes
1answer
1k views

Rename image uploads with width in filename

I am attempting to change the name format that Wordpress uses to rename uploaded files. For example, when I upload an image with filename "cat-picture.jpg" Wordpress will create scaled versions and ...
0
votes
2answers
221 views

Can I the caption shortcode to set caption to a data attribute, and with the image's alignment intact?

I want to output an image caption in this kind of format: <img class="alignleft size-medium wp-image-316" alt="Image Title" data-caption="Here lies the image caption" ...
3
votes
1answer
1k views

Change html structure of all img tags in Wordpress

I have a Wordpress blog and am trying to implement the foresight.js image script. In short, I need to target all post images, swap out the src, width, & height attributes with data-src, ...
1
vote
1answer
167 views

Alter image output in content

I'm trying to implement the JAIL javascript into my WordPress install. The javascript requires me to add a data-attribute and change the output html of images. I have been looking through the codex ...
4
votes
2answers
824 views

Set JPEG compression for specific custom image sizes

I use various custom image sizes (by add_image_size) and I have set my JPEG compression to 30% with this filter: function jpeg_quality_callback($arg) { return (int)30; } add_filter('jpeg_quality', ...
0
votes
1answer
379 views

How can I remove the image attachment ALT field?

I've been using the technique described in this post to remove the caption and description fields in the uploads modal window, thus eliminating unused clutter for users. Since the title field is ...
2
votes
3answers
523 views

Filter to modify post_title after image upload?

When I upload images, Wordpress 3.4.2 sets the Title to the base of the filename, such as "DSCN1234" or "IMG_1234". I'd like the Title to be left blank. The code that sets the Title during the upload ...
4
votes
2answers
447 views

Removing default image size list in Media Box

I trying to remove unused image size (Thumbnail, Medium, Large) in MediaBox Any function can i use in functions.php ? or some trick ? PS : I know i can use jQuery trick but any better function to ...
0
votes
1answer
138 views

Is there any action/filter hook to use when an image gets edited in the editor?

I can't find a specific hook. If I already have added an image to an article via editor and then I edit it, I'd like to intercept the code just before it is sent again to the editor. I already use ...
6
votes
1answer
600 views

Changing JPEG compression depending on image size

Short. I want ''large' images compressed by 90%, and 'medium' to be by 60%. Has many af you know, sometimes larger images suffer from high compression, but other small images don't. This function ...
1
vote
1answer
615 views

add data-attribute to all images inside the_content()

I wonder if it's possible to add a filter to all images inside the_content() to create the following image pattern for all images … <img class="digest" src="smallest-file.jpg" ...
0
votes
2answers
527 views

Filter for post_thumbnail: link to small src and add data-attribute

I wonder how I can link manually to the smallest filesize for the_post_thumbnail() within its filter function … add_filter( 'post_thumbnail_html', 'post_thumbnail_html', 10, 3 ); function ...
3
votes
1answer
373 views

Preview Image Path in Admin Section

So I have run into a little glitch. i have a custom path for uploads and it works. the files get saved to the right place, etc. The problem I have is the 'widget box' in the admin section. immediately ...
1
vote
2answers
269 views

How can I add inline CSS for each image?

Is there a filter or hook that I can use for uploaded media? I need to use it for custom CSS properties based on the media's description. It will be like: <img src="image_url" style="width: ...
1
vote
1answer
77 views

Publish/Update post is changing image links from file url to post url

I've written a filter to wrap images included in posts with figure tags and their captions with figcaption tags. I turned off the visual editor so that it doesn't strip out all the html from the ...
0
votes
1answer
161 views

get_image_tag filter not working

I'm trying to get the custom field data off an attachment and display it following the image tag in a page/post using the get_image_tag filter. I'm using the same function to get the same data and ...
6
votes
1answer
4k views

Removing Image and Caption Dimension Attributes

This question is an offshoot from the this discussion on removing dimension attributes from images. The solution code provided on that thread works very well except that it has the unfortunate side ...
1
vote
2answers
2k views

Need help building a filter to edit the output of “image_send_to_editor”

What I'm trying to do is edit the output of image_send_to_editor so that i can make the anchor that wraps around the image have a specific class & rel. I plan to basically make each image that ...
3
votes
2answers
5k views

Default Image Link Removal

Just wondering if there is a way to remove WordPress's default function of adding a tag around an inserted image. I assume its a "remove_filter" function like you can do for WPAutoP, but all my ...
0
votes
3answers
1k views

What's the proper way to use the get_image_tag filter?

I'm attempting to remove the title attribute for post thumbnails (on certain posts), and I assume the get_image_tag filter is the way to do this. However, what I've got so far isn't working. What do I ...
0
votes
3answers
575 views

How to retrieve the postID in a “image_send_to_editor” hook function?

Here is my function: function insert_img_rel_attrib( $html, $id, $caption, $title, $align, $url ) { $postID = ??? $rel = "<a rel='shadowbox[".$postID."]'"; if ($url) {$html = ...
2
votes
2answers
506 views

Best way to programatically add “rel” attributes to page and post images

For single posts and pages, I would like to add certain rel attributes to all the images on the contained therein added with the "Add Image" functionality on the edit screen. The attribute would be ...
0
votes
2answers
256 views

How to internationalize header image?

I have in the following code in the template: <img src="<?php header_image(); ?>" /> However, I want to change this image according to the language selected (through GET parameter ...
2
votes
1answer
340 views

There's some way to add a wrapper around posted images?

I need to add a wrapper (I'll use <figure> in my example) around images posted through the editor, with a variable depending on the size image is being posted (thumbnail, medium, large, full), ...
1
vote
2answers
8k views

how to display post content without post image?

i've implemented a jQuery gallery for displaying several images within a post. the problem is that the_content(); also displays the post image. any ideas how to filter it? thanks
1
vote
3answers
8k views

Remove title attribute from images

I'm looking for a way to remove the title attribute from images, preferably through using a hook or a filter. Most clients don't bother giving images a proper title, thus eliminating the purpose of ...
23
votes
4answers
13k views

Filter to remove image dimension attributes?

I'm working on a site based on a fluid width css template which sets a max-width on images to the width of the column containing them, and I need to remove the inline width and height dimension ...
0
votes
1answer
760 views

How to display a shortcode caption somewhere other than the_content

I want to disable shortcode captions for posts in one of my themes, and display the content elsewhere, such as in a sidebar. The images aren't uploaded to wordpress, but they're linked-to using the ...