/** * Initialise WP hooks */ private static function init_hooks() { if (LFAPPS_Chat::chat_active()) { add_action('wp_footer', array('LFAPPS_Chat', 'init_script')); // Set comments_template filter to maximum value to always override the default commenting widget add_filter('comments_template', array('LFAPPS_Chat', 'comments_template'), self::lf_widget_priority()); add_filter('comments_number', array('LFAPPS_Chat', 'comments_number'), 10, 2); add_shortcode('livefyre_livechat', array('LFAPPS_Chat', 'init_shortcode')); } }
?> " }; if(typeof(liveChatConfig) !== 'undefined') { convConfigChat<?php echo esc_js($articleId); ?> = Livefyre.LFAPPS.lfExtend(liveChatConfig, convConfigChat<?php echo esc_js($articleId); ?> ); } Livefyre.require(['<?php echo LFAPPS_Chat::get_package_reference(); ?> '], function(ConvChat) { load_livefyre_auth(); new ConvChat(networkConfigChat, [convConfigChat<?php echo esc_js($articleId); ?> ], function(chatWidget) { if(typeof chatWidget !== "undefined") { var livechatListeners = Livefyre.LFAPPS.getAppEventListeners('livechat'); if(livechatListeners.length > 0) { for(var i=0; i<livechatListeners; i++)) { var livechatListener = livechatListeners[i]; chatWidget.on(livechatListener.eventName, livechatListener.callback); } }
public static function livefyre_comments_template() { if (class_exists('LFAPPS_Chat') && !self::livefyre_show_comments() && LFAPPS_Chat::show_chat()) { return LFAPPS_Chat::comments_template(); } return dirname(__FILE__) . '/views/comments-template.php'; }
<?php /* * Template file for Livefyre's div element. */ global $livefyre, $wp_query, $post; if (LFAPPS_Chat::show_chat()) { echo '<div id="livefyre-chat"></div>'; } if (pings_open()) { $num_pings = count(get_comments(array('post_id' => $post->ID, 'type' => 'pingback', 'status' => 'approve'))) + count(get_comments(array('post_id' => $post->ID, 'type' => 'trackback', 'status' => 'approve'))); if ($num_pings > 0) { ?> <div style="font-family: arial !important;" id="lf_pings"> <h3>Trackbacks</h3> <ol class="commentlist"> <?php wp_list_comments(array('type' => 'pings', 'reply_text' => '')); ?> </ol> </div> <?php } }