disable flood control
This commit is contained in:
parent
f07ae2ea8c
commit
46436cb49b
1 changed files with 12 additions and 0 deletions
|
@ -309,12 +309,18 @@ class Inbox {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// disable flood control
|
||||||
|
\remove_action( 'check_comment_flood', 'check_comment_flood_db', 10 );
|
||||||
|
|
||||||
// do not require email for AP entries
|
// do not require email for AP entries
|
||||||
\add_filter( 'pre_option_require_name_email', '__return_false' );
|
\add_filter( 'pre_option_require_name_email', '__return_false' );
|
||||||
|
|
||||||
$state = \wp_new_comment( $commentdata, true );
|
$state = \wp_new_comment( $commentdata, true );
|
||||||
|
|
||||||
\remove_filter( 'pre_option_require_name_email', '__return_false' );
|
\remove_filter( 'pre_option_require_name_email', '__return_false' );
|
||||||
|
|
||||||
|
// re-add flood control
|
||||||
|
\add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -348,11 +354,17 @@ class Inbox {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// disable flood control
|
||||||
|
\remove_action( 'check_comment_flood', 'check_comment_flood_db', 10 );
|
||||||
|
|
||||||
// do not require email for AP entries
|
// do not require email for AP entries
|
||||||
\add_filter( 'pre_option_require_name_email', '__return_false' );
|
\add_filter( 'pre_option_require_name_email', '__return_false' );
|
||||||
|
|
||||||
$state = \wp_new_comment( $commentdata, true );
|
$state = \wp_new_comment( $commentdata, true );
|
||||||
|
|
||||||
\remove_filter( 'pre_option_require_name_email', '__return_false' );
|
\remove_filter( 'pre_option_require_name_email', '__return_false' );
|
||||||
|
|
||||||
|
// re-add flood control
|
||||||
|
\add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue