| @@ -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 | |