function duoshuo_initialize() { global $duoshuoPlugin; if (empty($duoshuoPlugin->shortName) || empty($duoshuoPlugin->secret)) { return; } if ($duoshuoPlugin->getOption('social_login_enabled')) { add_action('login_form', array($duoshuoPlugin, 'loginForm')); } //add_action('wp_login', array($duoshuoPlugin, 'login')); // wp2.8 以后支持这个事件 add_action('wp_print_scripts', array($duoshuoPlugin, 'appendScripts')); //add_action('wp_head', array($duoshuoPlugin, 'appendStyles')); //以下应该根据是否设置,选择是否启用 add_filter('comments_template', array($duoshuoPlugin, 'commentsTemplate')); //add_filter('comments_number') if (is_active_widget(false, false, 'recent-comments')) { add_action('wp_footer', array($duoshuoPlugin, 'outputFooterCommentJs')); } if (get_option('duoshuo_cc_fix')) { //直接输出HTML评论 add_filter('comments_number', array($duoshuoPlugin, 'commentsText')); } add_action('trackback_post', array($duoshuoPlugin, 'exportOneComment')); add_action('pingback_post', array($duoshuoPlugin, 'exportOneComment')); duoshuo_common_initialize(); }
function duoshuo_initialize() { global $duoshuoPlugin; if (empty($duoshuoPlugin->shortName) || empty($duoshuoPlugin->secret)) { return; } if ($duoshuoPlugin->getOption('social_login_enabled')) { add_action('login_form', array($duoshuoPlugin, 'loginForm')); add_action('register_form', array($duoshuoPlugin, 'loginForm')); } // wp2.8 以后支持这个事件 add_action(get_option('duoshuo_postpone_print_scripts') ? 'wp_print_footer_scripts' : 'wp_print_scripts', array($duoshuoPlugin, 'appendScripts')); //以下应该根据是否设置,选择是否启用 add_filter('comments_template', array($duoshuoPlugin, 'commentsTemplate')); if (get_option('duoshuo_cc_fix')) { //直接输出HTML评论 add_filter('comments_popup_link_attributes', array($duoshuoPlugin, 'commentsPopupLinkAttributes')); add_filter('comments_number', array($duoshuoPlugin, 'commentsText')); } if (get_option('duoshuo_sync_pingback_and_trackback')) { add_action('trackback_post', array($duoshuoPlugin, 'exportOneComment')); add_action('pingback_post', array($duoshuoPlugin, 'exportOneComment')); } duoshuo_common_initialize(); }