|
@@ -3,7 +3,7 @@ discard block |
|
|
block discarded – undo |
|
3
|
3
|
|
|
4
|
4
|
use Flynt\Utils\Options; |
|
5
|
5
|
|
|
6
|
|
-add_filter('pre_http_request', function ($preempt, $args, $url) { |
|
|
6
|
+add_filter('pre_http_request', function($preempt, $args, $url) { |
|
7
|
7
|
if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) { |
|
8
|
8
|
$response = wp_cache_get($url, 'oembedCache'); |
|
9
|
9
|
if (!empty($response)) { |
|
@@ -13,14 +13,14 @@ discard block |
|
|
block discarded – undo |
|
13
|
13
|
return false; |
|
14
|
14
|
}, 10, 3); |
|
15
|
15
|
|
|
16
|
|
-add_filter('http_response', function ($response, $args, $url) { |
|
|
16
|
+add_filter('http_response', function($response, $args, $url) { |
|
17
|
17
|
if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) { |
|
18
|
18
|
wp_cache_set($url, $response, 'oembedCache'); |
|
19
|
19
|
} |
|
20
|
20
|
return $response; |
|
21
|
21
|
}, 10, 3); |
|
22
|
22
|
|
|
23
|
|
-add_filter('acf/fields/google_map/api', function ($api) { |
|
|
23
|
+add_filter('acf/fields/google_map/api', function($api) { |
|
24
|
24
|
$apiKey = Options::get('globalOptions', 'component', 'Acf', 'googleMapsApiKey'); |
|
25
|
25
|
if ($apiKey) { |
|
26
|
26
|
$api['key'] = $apiKey; |
Please login to merge, or discard this patch.