api.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. *
  4. * FUNCTIONS THAT CAN BE USED BY THEMES/PLUGINS DEVELOPERS
  5. * FOR ADDITIONAL RETINA SUPPORT
  6. *
  7. */
  8. // Rewrite the HTML to add Retina support (not recommended, that is
  9. // done automatically by the plugin through the Method)
  10. function wr2x_picture_rewrite( $buffer ) {
  11. global $wr2x_core;
  12. return $wr2x_core->picture_rewrite( $buffer );
  13. }
  14. // Return Retina URL from the Image URL
  15. function wr2x_get_retina_from_url( $url ) {
  16. global $wr2x_core;
  17. return $wr2x_core->get_retina_from_url( $url );
  18. }
  19. // Return the retina file if my found for this normal file
  20. function wr2x_get_retina( $file ) {
  21. global $wr2x_core;
  22. return $wr2x_core->get_retina( $file );
  23. }
  24. // Generate the retina images for the given meta of a media
  25. function wr2x_generate_images( $meta ) {
  26. global $wr2x_core;
  27. return $wr2x_core->generate_images( $meta );
  28. }
  29. // Delete the Retina files for this attachment
  30. function wr2x_delete_attachment( $attach_id, $deleteFullSize = true ) {
  31. global $wr2x_core;
  32. return $wr2x_core->delete_attachment( $attach_id, $deleteFullSize );
  33. }
  34. function wr2x_get_pathinfo_from_image_src( $image_src ) {
  35. global $wr2x_core;
  36. return $wr2x_core->get_pathinfo_from_image_src( $image_src );
  37. }
  38. function wr2x_retina_extension() {
  39. global $wr2x_core;
  40. return $wr2x_core->retina_extension();
  41. }
  42. ?>