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
imagify / inc / deprecated / Traits / Media / WPDeprecatedTrait.php

WPDeprecatedTrait.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF trunk, at inc/deprecated/Traits/Media/WPDeprecatedTrait.php

41 lines 844 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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