<?php

if (!defined('ABSPATH')) exit;


function elfsight_instagram_testimonials_shortcode_options_filter($options) {
    if (is_array($options)) {
        $options['api'] = admin_url('admin-ajax.php');
    }

    return $options;
}
add_filter('elfsight_instagram_testimonials_shortcode_options', 'elfsight_instagram_testimonials_shortcode_options_filter');


function elfsight_instagram_testimonials_widget_options_filter($options_json) {
    $options = json_decode($options_json, true);

    if (is_array($options)) {
        unset($options['api']);
    }

    return json_encode($options);
}
add_filter('elfsight_instagram_testimonials_widget_options', 'elfsight_instagram_testimonials_widget_options_filter');