Skip to content

Commit 910230f

Browse files
committed
remove legacy code.
1 parent 2ba6722 commit 910230f

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

inc/url_replacer.php

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -42,49 +42,6 @@ public static function instance() {
4242
return self::$instance;
4343
}
4444

45-
/**
46-
* A filter which turns a local url into an optimized CDN image url or an array of image urls.
47-
*
48-
* @param string|array $url The url which should be replaced.
49-
*
50-
* @return string|array Replaced url.
51-
*/
52-
public function replace_option_url( $url ) {
53-
if ( empty( $url ) ) {
54-
return $url;
55-
}
56-
57-
// $url might be an array or an json encoded array with urls.
58-
if ( is_array( $url ) || filter_var( $url, FILTER_VALIDATE_URL ) === false ) {
59-
$array = $url;
60-
$encoded = false;
61-
62-
// it might a json encoded array
63-
if ( is_string( $url ) ) {
64-
$array = json_decode( $url, true );
65-
$encoded = true;
66-
}
67-
68-
// in case there is an array, apply it recursively.
69-
if ( is_array( $array ) ) {
70-
foreach ( $array as $index => $value ) {
71-
$array[ $index ] = $this->replace_option_url( $value );
72-
}
73-
74-
if ( $encoded ) {
75-
return json_encode( $array );
76-
}
77-
78-
return $array;
79-
}
80-
81-
if ( filter_var( $url, FILTER_VALIDATE_URL ) === false ) {
82-
return $url;
83-
}
84-
}
85-
86-
return apply_filters( 'optml_content_url', $url );
87-
}
8845

8946
/**
9047
* The initialize method.

0 commit comments

Comments
 (0)