/** * Initializes WordPress hooks */ private static function init_hooks() { self::$initiated = true; add_action('wp_insert_comment', array('Akismet', 'auto_check_update_meta'), 10, 2); add_action('preprocess_comment', array('Akismet', 'auto_check_comment'), 1); add_action('akismet_scheduled_delete', array('Akismet', 'delete_old_comments')); add_action('akismet_scheduled_delete', array('Akismet', 'delete_old_comments_meta')); add_action('akismet_schedule_cron_recheck', array('Akismet', 'cron_recheck')); $akismet_comment_nonce_option = apply_filters('akismet_comment_nonce', get_option('akismet_comment_nonce')); if ($akismet_comment_nonce_option == 'true' || $akismet_comment_nonce_option == '') { add_action('comment_form', array('Akismet', 'add_comment_nonce'), 1); } add_action('admin_head-edit-comments.php', array('Akismet', 'load_form_js')); add_action('comment_form', array('Akismet', 'load_form_js')); add_action('comment_form', array('Akismet', 'inject_ak_js')); add_filter('comment_moderation_recipients', array('Akismet', 'disable_moderation_emails_if_unreachable'), 1000, 2); add_filter('pre_comment_approved', array('Akismet', 'last_comment_status'), 10, 2); add_action('transition_comment_status', array('Akismet', 'transition_comment_status'), 10, 3); if ('3.0.5' == $GLOBALS['wp_version']) { remove_filter('comment_text', 'wp_kses_data'); if (is_admin()) { add_filter('comment_text', 'wp_kses_post'); } } }
/** * Initializes WordPress hooks */ private static function init_hooks() { self::$initiated = true; add_action('wp_insert_comment', array('Akismet', 'auto_check_update_meta'), 10, 2); add_filter('preprocess_comment', array('Akismet', 'auto_check_comment'), 1); add_action('akismet_scheduled_delete', array('Akismet', 'delete_old_comments')); add_action('akismet_scheduled_delete', array('Akismet', 'delete_old_comments_meta')); add_action('akismet_schedule_cron_recheck', array('Akismet', 'cron_recheck')); /** * To disable the Akismet comment nonce, add a filter for the 'akismet_comment_nonce' tag * and return any string value that is not 'true' or '' (empty string). * * Don't return boolean false, because that implies that the 'akismet_comment_nonce' option * has not been set and that Akismet should just choose the default behavior for that * situation. */ $akismet_comment_nonce_option = apply_filters('akismet_comment_nonce', get_option('akismet_comment_nonce')); if ($akismet_comment_nonce_option == 'true' || $akismet_comment_nonce_option == '') { add_action('comment_form', array('Akismet', 'add_comment_nonce'), 1); } add_action('admin_head-edit-comments.php', array('Akismet', 'load_form_js')); add_action('comment_form', array('Akismet', 'load_form_js')); add_action('comment_form', array('Akismet', 'inject_ak_js')); add_filter('comment_moderation_recipients', array('Akismet', 'disable_moderation_emails_if_unreachable'), 1000, 2); add_filter('pre_comment_approved', array('Akismet', 'last_comment_status'), 10, 2); add_action('transition_comment_status', array('Akismet', 'transition_comment_status'), 10, 3); // Run this early in the pingback call, before doing a remote fetch of the source uri add_action('xmlrpc_call', array('Akismet', 'pre_check_pingback')); }
/** * Initializes WordPress hooks */ private static function init_hooks() { self::$initiated = true; add_action('wp_insert_comment', array('Akismet', 'auto_check_update_meta'), 10, 2); add_filter('preprocess_comment', array('Akismet', 'auto_check_comment'), 1); add_action('akismet_scheduled_delete', array('Akismet', 'delete_old_comments')); add_action('akismet_scheduled_delete', array('Akismet', 'delete_old_comments_meta')); add_action('akismet_schedule_cron_recheck', array('Akismet', 'cron_recheck')); $akismet_comment_nonce_option = apply_filters('akismet_comment_nonce', get_option('akismet_comment_nonce')); if ($akismet_comment_nonce_option == 'true' || $akismet_comment_nonce_option == '') { add_action('comment_form', array('Akismet', 'add_comment_nonce'), 1); } add_action('admin_head-edit-comments.php', array('Akismet', 'load_form_js')); add_action('comment_form', array('Akismet', 'load_form_js')); add_action('comment_form', array('Akismet', 'inject_ak_js')); add_filter('comment_moderation_recipients', array('Akismet', 'disable_moderation_emails_if_unreachable'), 1000, 2); add_filter('pre_comment_approved', array('Akismet', 'last_comment_status'), 10, 2); add_action('transition_comment_status', array('Akismet', 'transition_comment_status'), 10, 3); // Run this early in the pingback call, before doing a remote fetch of the source uri add_action('xmlrpc_call', array('Akismet', 'pre_check_pingback')); }