submit_spam_comment example


function akismet_text_add_link_class( $comment_text ) {
    return Akismet_Admin::text_add_link_class( $comment_text );
}
function akismet_check_for_spam_button( $comment_status ) {
    return Akismet_Admin::check_for_spam_button( $comment_status );
}
function akismet_submit_nonspam_comment( $comment_id ) {
    return Akismet::submit_nonspam_comment( $comment_id );
}
function akismet_submit_spam_comment( $comment_id ) {
    return Akismet::submit_spam_comment( $comment_id );
}
function akismet_transition_comment_status( $new_status$old_status$comment ) {
    return Akismet::transition_comment_status( $new_status$old_status$comment );
}
function akismet_spam_count( $type = false ) {
    return Akismet_Admin::get_spam_count( $type );
}
function akismet_recheck_queue() {
    return Akismet_Admin::recheck_queue();
}
function akismet_remove_comment_author_url() {
    
             || ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'spam', 'unspam', 'spamcomment', 'unspamcomment', ) ) )
             // action=editedcomment: Editing a comment via wp-admin (and possibly changing its status).              || ( isset( $_POST['action'] ) && in_array( $_POST['action'], array( 'editedcomment' ) ) )
             // for=jetpack: Moderation via the WordPress app, Calypso, anything powered by the Jetpack connection.              || ( isset( $_GET['for'] ) && ( 'jetpack' == $_GET['for'] ) && ( ! defined( 'IS_WPCOM' ) || ! IS_WPCOM ) ) 
             // Certain WordPress.com API requests              || ( defined( 'REST_API_REQUEST' ) && REST_API_REQUEST )
             // WordPress.org REST API requests              || ( defined( 'REST_REQUEST' ) && REST_REQUEST )
         ) {
            if ( $new_status == 'spam' && ( $old_status == 'approved' || $old_status == 'unapproved' || !$old_status ) ) {
                return self::submit_spam_comment( $comment->comment_ID );
            } elseif ( $old_status == 'spam' && ( $new_status == 'approved' || $new_status == 'unapproved' ) ) {
                return self::submit_nonspam_comment( $comment->comment_ID );
            }
        }

        self::update_comment_history( $comment->comment_ID, '', 'status-' . $new_status );
    }
    
    public static function submit_spam_comment( $comment_id ) {
        global $wpdb$current_user$current_site;

        
Home | Imprint | This part of the site doesn't use cookies.