diff --git a/includes/fields/class-acf-field-oembed.php b/includes/fields/class-acf-field-oembed.php index d13470e9..555f8819 100644 --- a/includes/fields/class-acf-field-oembed.php +++ b/includes/fields/class-acf-field-oembed.php @@ -88,9 +88,16 @@ function wp_oembed_get( $url = '', $width = 0, $height = 0 ) { 'width' => $width, 'height' => $height, ); - - // get emebed - $embed = @wp_oembed_get( $url, $res ); + + // check if a transient exist for this oembed, to reduce API calls + $embed = get_transient($url); + + if(!$embed){ + + // get emebed + $embed = @wp_oembed_get($url, $res); + set_transient($url, $embed); + } // try shortcode if ( ! $embed ) {