| @@ -1,6 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +use Optimole\Sdk\Resource\ImageProperty\ResizeTypeProperty; | |
| 4 | +use Optimole\Sdk\ValueObject\Position; | |
| 5 | + | |
| 3 | 6 | /** |
| 4 | 7 | * Class Optml_shortcode_ultimate. |
| 5 | 8 | * |
| 6 | 9 | * @reason Shortcode Ultimate uses a strange image resizing feature |
| @@ -24,10 +27,10 @@ | ||
| 24 | 27 | * Should we load the integration logic. |
| 25 | 28 | * |
| 26 | 29 | * @return bool Should we load. |
| 27 | 30 | */ |
| 28 | - function should_load() { | |
| 29 | - include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | |
| 31 | + public function should_load() { | |
| 32 | + include_once ABSPATH . 'wp-admin/includes/plugin.php'; | |
| 30 | 33 | |
| 31 | 34 | return is_plugin_active( 'shortcodes-ultimate/shortcodes-ultimate.php' ); |
| 32 | 35 | } |
| 33 | 36 | |
| @@ -46,9 +49,9 @@ | ||
| 46 | 49 | * @param array $attr Shortcode attrs. |
| 47 | 50 | * |
| 48 | 51 | * @return mixed New output. |
| 49 | 52 | */ |
| 50 | - function alter_shortcode_output( $output, $tag, $attr ) { | |
| 53 | + public function alter_shortcode_output( $output, $tag, $attr ) { | |
| 51 | 54 | |
| 52 | 55 | if ( ! isset( $this->allowed_tags[ $tag ] ) ) { |
| 53 | 56 | return $output; |
| 54 | 57 | } |
| @@ -70,9 +73,9 @@ | ||
| 70 | 73 | * @return array New default cropping. |
| 71 | 74 | */ |
| 72 | 75 | public function change_default_crop() { |
| 73 | 76 | return [ |
| 74 | - 'type' => Optml_Resize::RESIZE_FILL, | |
| 75 | - 'gravity' => Optml_Resize::GRAVITY_CENTER, | |
| 77 | + 'type' => ResizeTypeProperty::FILL, | |
| 78 | + 'gravity' => Position::CENTER, | |
| 76 | 79 | ]; |
| 77 | 80 | } |
| 78 | 81 | } |