我安装了FB自动登录插件,并编写了自己的自定义javascript来处理登录。现在我的问题是,如何用我自己的函数来覆盖jfb\\u output\\u facebook\\u init函数,例如,该函数回显“Hello World”?
add_action(\'wp_footer\', \'jfb_output_facebook_init\');
function jfb_output_facebook_init()
{
global $jfb_name, $jfb_version, $opt_jfb_app_id, $opt_jfb_api_key, $opt_jfb_valid;
if( !get_option($opt_jfb_valid) ) return;
$channelURL = plugins_url(dirname(plugin_basename(__FILE__))) . "/facebook-platform/channel.html";
echo "\\n<!-- $jfb_name Init v$jfb_version (NEW API) -->\\n";
?>
<div id="fb-root"></div>
<script type="text/javascript">//<!--
window.fbAsyncInit = function()
{
FB.init({
appId: \'<?php echo get_option($opt_jfb_app_id); ?>\', status: true, cookie: true, xfbml: true, oauth:true, channelUrl: \'<?php echo $channelURL; ?>\'
});
<?php do_action(\'wpfb_add_to_asyncinit\'); ?>
};
(function() {
var e = document.createElement(\'script\');
e.src = document.location.protocol + \'//connect.facebook.net/<?php echo apply_filters(\'wpfb_output_facebook_locale\', \'en_US\'); ?>/all.js\';
e.async = true;
document.getElementById(\'fb-root\').appendChild(e);
}());
//--></script>
}