PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / trunk
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF vtrunk
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
← All changes | classes/Media/CustomFolders.php +8 -6 1.10 → trunk View file →
@@ -1,8 +1,10 @@
1 1 <?php
2 2 namespace Imagify\Media;
3 3
4 -defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
4 +use Imagify\Traits\MediaRowTrait;
5 +use Imagify\Deprecated\Traits\Media\CustomFoldersDeprecatedTrait;
6 +use WP_Error;
5 7
6 8 /**
7 9 * Media class for the custom folders.
8 10 *
@@ -9,10 +11,10 @@
9 11 * @since 1.9
10 12 * @author Grégory Viguier
11 13 */
12 14 class CustomFolders extends AbstractMedia {
13 - use \Imagify\Traits\MediaRowTrait;
14 - use \Imagify\Deprecated\Traits\Media\CustomFoldersDeprecatedTrait;
15 + use MediaRowTrait;
16 + use CustomFoldersDeprecatedTrait;
15 17
16 18 /**
17 19 * Context (where the media "comes from").
18 20 *
@@ -227,13 +229,13 @@
227 229 * @since 1.9
228 230 * @access public
229 231 * @author Grégory Viguier
230 232 *
231 - * @return bool|WP_Error True on success. A \WP_Error instance on failure.
233 + * @return bool|WP_Error True on success. A WP_Error instance on failure.
232 234 */
233 235 public function generate_thumbnails() {
234 236 if ( ! $this->is_valid() ) {
235 - return new \WP_Error( 'invalid_media', __( 'This media is not valid.', 'imagify' ) );
237 + return new WP_Error( 'invalid_media', __( 'This media is not valid.', 'imagify' ) );
236 238 }
237 239
238 240 return true;
239 241 }
@@ -319,9 +321,9 @@
319 321
320 322 $row = $this->get_row();
321 323
322 324 return [
323 - 'width' => ! empty( $row['width'] ) ? $row['width'] : 0,
325 + 'width' => ! empty( $row['width'] ) ? $row['width'] : 0,
324 326 'height' => ! empty( $row['height'] ) ? $row['height'] : 0,
325 327 ];
326 328 }
327 329