Support » Plugin: WP DSGVO Tools (GDPR) » Add filter for sp-dsgvo script parameters

  • Resolved edo888

    (@edo888)


    Hi,

    Please make it possible to modify sp-dsgvo script vars with a callback using apply_filters wordpress function. More info: https://developer.wordpress.org/reference/functions/apply_filters/

    I would like to modify the variables below before it is rendered.

    wp_localize_script(sp_dsgvo_NAME, 'cnArgs', array(
                'ajaxurl' => admin_url('admin-ajax.php'),
                'hideEffect' => SPDSGVOSettings::get('cn_animation'),
                'onScroll' => false,
                'onScrollOffset' => 100,
                'cookieName' => self::$cookie['name'],
                'cookieValue' => self::$cookie['value'],
                'cookieTime' => SPDSGVOSettings::get('cn_cookie_validity'),
                'cookiePath' => (defined('COOKIEPATH') ? COOKIEPATH : ''),
                'cookieDomain' => (defined('COOKIE_DOMAIN') ? COOKIE_DOMAIN : ''),
                'redirection' => SPDSGVOSettings::get('cn_reload_on_confirm'),
                'reloadOnConfirm' => SPDSGVOSettings::get('cn_reload_on_confirm'),
                'trackerInitMoment' => SPDSGVOSettings::get('cn_tracker_init'),
                'gaTagNumber' => SPDSGVOSettings::get('ga_tag_number'),
                'cache' => defined('WP_CACHE') && WP_CACHE,
                'declineTargetUrl' => SPDSGVOSettings::get('cn_decline_target_url'),
                'declineNoCookie' => SPDSGVOSettings::get('cn_decline_no_cookie'),
                'commentsCb'=> SPDSGVOSettings::get('sp_dsgvo_comments_checkbox'),
                'cf7AccReplace' => SPDSGVOSettings::get('sp_dsgvo_cf7_acceptance_replace'),
                'cf7AccText' => SPDSGVOSettings::get('spdsgvo_comments_checkbox_text')
            ));

    I’m trying to make your plugin compatible with GTranslate plugin by adding some keys, so GTranslate knows what can be translated. For example like this:

    
    ...
    'gt_translate_keys' => array('cf7AccText'),
    ...
    

    Which defines which keys can be translated.

    Thanks! 🙂

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Add filter for sp-dsgvo script parameters’ is closed to new replies.