jfb_output_facebook_init

The WP-FB-AutoConnect jfb output facebook init function.

Description

jfb_output_facebook_init(); 

Usage

  1. if ( !function_exists( 'jfb_output_facebook_init' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'wp-fb-autoconnect/Main.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = jfb_output_facebook_init(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/Main.php  
  1. function jfb_output_facebook_init() 
  2. global $jfb_name, $jfb_version, $opt_jfb_app_id, $opt_jfb_api_key, $opt_jfb_valid, $jfb_apiver; 
  3. if( !get_option($opt_jfb_valid) ) return; 
  4.  
  5. echo "\n<!-- $jfb_name Init v$jfb_version (NEW API) -->\n"; 
  6. ?> 
  7. <div id="fb-root"></div> 
  8. <script type="text/javascript">//<!-- 
  9. window.fbAsyncInit = function() 
  10. FB.init({ 
  11. appId: '<?php echo get_option($opt_jfb_app_id); ?>',  
  12. status: true,  
  13. cookie: true,  
  14. xfbml: true,  
  15. version: '<?php echo $jfb_apiver?>' 
  16. }); 
  17. <?php do_action('wpfb_add_to_asyncinit'); ?>  
  18. }; 
  19.  
  20. (function() { 
  21. var e = document.createElement('script'); 
  22. e.src = document.location.protocol + '//connect.facebook.net/<?php echo apply_filters('wpfb_output_facebook_locale', 'en_US'); ?>/sdk.js'; 
  23. e.async = true; 
  24. document.getElementById('fb-root').appendChild(e); 
  25. }()); 
  26. //--></script> 
  27. <?php