WordPress.org

Plugin Directory

WP Retina 2x

Make your website look beautiful and crisp on Retina / High DPI displays.

Users, you will find the FAQ here: http://apps.meow.fr/wp-retina-2x/faq/.

Developers, WP Retina 2x has a little API. Here are a few filters and actions you might want to use.

Functions

  • wr2x_get_retina_from_url( $url ): return the URL of the retina image (empty string if not found)
  • wr2x_get_retina( $syspath ): return the system path of the retina image (null if not found)

Actions

  • wr2x_retina_file_added: called when a new retina file is created, 1st argument is $attachment_id (of the media) and second is the $retina_filepath
  • wr2x_retina_file_removed: called when a new retina file is removed, 1st argument is $attachment_id (of the media) and second is the $retina_filepath

Filters

  • wr2x_img_url: you can check and potentially override the $wr2x_img_url (normal/original image from the src) that will be used in the srcset for 1x
  • wr2x_img_retina_url: you can check and potentially override the $wr2x_img_retina_url (retina image) that will be used in the srcset for 2x
  • wr2x_img_src: you can check and potentially override the $wr2x_img_src that will be used in the img's src (only used in Pro version)
  • wr2x_validate_src: the img src is passed; return it if it is valid, return null if it should be skipped

Requires: 3.5 or higher
Compatible up to: 4.2.3
Last Updated: 2015-7-21
Active Installs: 100,000+

Ratings

4.9 out of 5 stars

Support

34 of 36 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

1 person says it works.
1 person says it's broken.

100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,1,1 100,6,6 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,2,2 86,7,6 100,1,1
50,2,1 67,3,2 100,1,1 100,1,1 100,2,2 100,1,1
100,2,2 100,1,1 100,1,1 100,5,5
75,4,3 100,1,1
100,1,1 100,1,1 100,2,2 100,1,1
100,3,3
50,2,1
100,2,2
100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,3,3
100,1,1
100,1,1 100,1,1
100,1,1 100,1,1 100,2,2
100,1,1 100,1,1
50,2,1 100,3,3 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1
60,5,3 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 67,3,2 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 50,2,1