File tree Expand file tree Collapse file tree 1 file changed +0
-43
lines changed Expand file tree Collapse file tree 1 file changed +0
-43
lines changed Original file line number Diff line number Diff line change @@ -42,49 +42,6 @@ public static function instance() {
42
42
return self ::$ instance ;
43
43
}
44
44
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
- }
88
45
89
46
/**
90
47
* The initialize method.
You can’t perform that action at this time.
0 commit comments