mock-image-editor.php 925 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. if (class_exists( 'WP_Image_Editor' ) ) :
  3. class WP_Image_Editor_Mock extends WP_Image_Editor {
  4. public static $load_return = true;
  5. public static $test_return = true;
  6. public static $save_return = array();
  7. public function load() {
  8. return self::$load_return;
  9. }
  10. public static function test( $args = array() ) {
  11. return self::$test_return;
  12. }
  13. public static function supports_mime_type( $mime_type ) {
  14. return true;
  15. }
  16. public function resize( $max_w, $max_h, $crop = false ) {
  17. }
  18. public function multi_resize( $sizes ) {
  19. }
  20. public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) {
  21. }
  22. public function rotate( $angle ) {
  23. }
  24. public function flip( $horz, $vert ) {
  25. }
  26. public function save( $destfilename = null, $mime_type = null ) {
  27. return self::$save_return;
  28. }
  29. public function stream( $mime_type = null ) {
  30. }
  31. }
  32. endif;