Plugin Directory

Changeset 2090511


Ignore:
Timestamp:
05/18/2019 03:04:04 PM (7 years ago)
Author:
qdinar
Message:

regard options about comment must be manually approved or author must have previously approved comment

Location:
question-antispam-for-comment-and-signup/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • question-antispam-for-comment-and-signup/trunk/question-antispam-for-comment-and-signup.php

    r2080057 r2090511  
    66 Author: Dinar Qurbanov
    77 Author URI: http://qdb.wp.kukmara-rayon.ru/
    8  Version: 0.1.4
     8 Version: 0.1.5
    99
    1010 I have used WordPress Hashcash code, also I have looked at buhsl-Captcha, Cookies for Comments, Peter's Custom Anti-Spam codes, to learn and use their codes, and also copied something from them
     
    4848
    4949/**
    50  * Install WP Hashcash
     50 * Install Question Antispam for Comment and Signup
    5151 */
    5252
     
    321321
    322322
     323/**
     324 * Hook into the comment form
     325 */
    323326
    324327
     
    387390        }
    388391    } else {
    389         add_filter('pre_comment_approved', create_function('', 'return 1;'));
     392        // add_filter('pre_comment_approved', create_function('', 'return 1;'));
     393        add_filter(
     394            'pre_comment_approved',
     395            function($approved,$commentdata){
     396                if($approved===0){
     397                    if( 1==get_option( 'comment_moderation' ) || 1==get_option( 'comment_whitelist' ) ){
     398                        return 0;
     399                    }
     400                    return 1;
     401                }
     402                return $approved;
     403            },
     404            199,
     405            2
     406        );
    390407        if($options['count']=='on'){
    391408            $options['comments-ham'] = ((int) $options['comments-ham']) + 1;
     
    402419
    403420
     421/**
     422 * Hook into the registration form
     423 */
    404424
    405425// https://codex.wordpress.org/Customizing_the_Registration_Form
  • question-antispam-for-comment-and-signup/trunk/readme.txt

    r2080057 r2090511  
    106106just to write "Tested up to: 4.8"
    107107
    108 0.1.4
     1082019-05-03
     109version 0.1.4
    109110added forgotten mb_strtlower and trim
    110111
     1122019-05-18
     113version 0.1.5
     114start to take in account "Comment must be manually approved" and "Comment author must have a previously approved comment" settings.
     115
     116
     117
     118
     119
Note: See TracChangeset for help on using the changeset viewer.