do not require email for AP entries
This commit is contained in:
parent
33d3c8c9ab
commit
53aa974461
1 changed files with 12 additions and 0 deletions
|
@ -297,8 +297,14 @@ class Inbox {
|
||||||
// disable flood control
|
// disable flood control
|
||||||
\remove_action( 'check_comment_flood', 'check_comment_flood_db', 10 );
|
\remove_action( 'check_comment_flood', 'check_comment_flood_db', 10 );
|
||||||
|
|
||||||
|
// do not require email for AP entries
|
||||||
|
$option = get_option( 'require_name_email' );
|
||||||
|
update_option( 'require_name_email', 0 );
|
||||||
|
|
||||||
$state = \wp_new_comment( $commentdata, true );
|
$state = \wp_new_comment( $commentdata, true );
|
||||||
|
|
||||||
|
update_option( 'require_name_email', $option );
|
||||||
|
|
||||||
// re-add flood control
|
// re-add flood control
|
||||||
\add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 );
|
\add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 );
|
||||||
}
|
}
|
||||||
|
@ -330,8 +336,14 @@ class Inbox {
|
||||||
// disable flood control
|
// disable flood control
|
||||||
\remove_action( 'check_comment_flood', 'check_comment_flood_db', 10 );
|
\remove_action( 'check_comment_flood', 'check_comment_flood_db', 10 );
|
||||||
|
|
||||||
|
// do not require email for AP entries
|
||||||
|
$option = get_option( 'require_name_email' );
|
||||||
|
update_option( 'require_name_email', 0 );
|
||||||
|
|
||||||
$state = \wp_new_comment( $commentdata, true );
|
$state = \wp_new_comment( $commentdata, true );
|
||||||
|
|
||||||
|
update_option( 'require_name_email', $option );
|
||||||
|
|
||||||
// re-add flood control
|
// re-add flood control
|
||||||
\add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 );
|
\add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue