Plugin Directory

Changeset 1332232


Ignore:
Timestamp:
01/20/2016 05:25:44 PM (10 years ago)
Author:
funifier
Message:

Enable public script Funifier and initialize the Funifier API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • funifier/trunk/funifier.php

    r1198178 r1332232  
    8989}
    9090
     91
     92/**
     93 * Add basic script - Website
     94 */
     95function site_funifier_basic_js(){
     96    $funifierApiKey = stripslashes(get_option('funifier-api-key'));
     97    wp_enqueue_script( 'my_custom_script', '//client2.funifier.com/2.0.0/funifier.js' );
     98    echo '<script type="text/javascript">';
     99    echo 'window.funifierAsyncInit = function(){ Funifier.init({ apiKey : "'.$funifierApiKey.'" },function(err){
     100            if(err==null){
     101               Funifier.widget._init();
     102            }
     103        }); };';
     104    echo "</script>";
     105}
     106
     107$funifierApiKey = stripslashes(get_option('funifier-api-key'));
     108if(!$funifierCheckWidgetSite && $funifierApiKey){
     109    add_action( 'wp_enqueue_scripts', 'site_funifier_basic_js' );
     110}
     111
     112
    91113/**
    92114 * Add Funifier Menu
Note: See TracChangeset for help on using the changeset viewer.