| 1 |
<?php |
| 2 |
namespace Imagify\Deprecated\Traits\Media; |
| 3 |
|
| 4 |
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' ); |
| 5 |
|
| 6 |
/** |
| 7 |
* Trait containing deprecated methods of the class \Imagify\Media\WP. |
| 8 |
* |
| 9 |
* @since |
| 10 |
* @author Grégory Viguier |
| 11 |
*/ |
| 12 |
trait WPDeprecatedTrait { |
| 13 |
|
| 14 |
/** |
| 15 |
* Get the original media's URL. |
| 16 |
* |
| 17 |
* @since 1.9 |
| 18 |
* @since Deprecated |
| 19 |
* @access public |
| 20 |
* @author Grégory Viguier |
| 21 |
* @deprecated |
| 22 |
* |
| 23 |
* @return string|bool The file URL. False on failure. |
| 24 |
*/ |
| 25 |
public function get_original_url() { |
| 26 |
_deprecated_function( get_class( $this ) . '::' . __FUNCTION__ . '()', '', '( new \Imagify\Media\WP( $id ) )->get_fullsize_url()' ); |
| 27 |
|
| 28 |
if ( ! $this->is_valid() ) { |
| 29 |
return false; |
| 30 |
} |
| 31 |
|
| 32 |
if ( $this->get_cdn() ) { |
| 33 |
return $this->get_cdn()->get_file_url(); |
| 34 |
} |
| 35 |
|
| 36 |
$url = wp_get_attachment_url( $this->id ); |
| 37 |
|
| 38 |
return $url ? $url : false; |
| 39 |
} |
| 40 |
} |
| 41 |
|