Tagged Questions
2
votes
1answer
79 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
54 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
335 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
87 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
387 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
99 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 ...
3
votes
1answer
303 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
133 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
247 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 ...
2
votes
2answers
201 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
64 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
339 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
429 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
319 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
285 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 ...
0
votes
2answers
2k views
How to replace p with div tag using preg_replace()? [closed]
I have this code in my webpage...
<p style="text-align: center;">
<a href="http://***.com/wp-content/uploads/2012/01/18169921.jpg">
<img ...
0
votes
1answer
215 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
64 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
124 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 ...
4
votes
1answer
2k 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
1k 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 ...
2
votes
2answers
4k 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
880 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
448 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
429 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
159 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
270 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), ...
0
votes
2answers
5k 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
7k 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 ...
19
votes
4answers
10k 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
696 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 ...
