| @@ -2,8 +2,9 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Spam check using WordPress spam comments |
| 4 | 4 | * |
| 5 | 5 | * @since 6.21 |
| 6 | + * | |
| 6 | 7 | * @package Formidable |
| 7 | 8 | */ |
| 8 | 9 | |
| 9 | 10 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -11,8 +12,11 @@ | ||
| 11 | 12 | } |
| 12 | 13 | |
| 13 | 14 | class FrmSpamCheckUseWPComments extends FrmSpamCheck { |
| 14 | 15 | |
| 16 | + /** | |
| 17 | + * @return bool | |
| 18 | + */ | |
| 15 | 19 | protected function check() { |
| 16 | 20 | $spam_comments = get_comments( |
| 17 | 21 | array( |
| 18 | 22 | 'status' => 'spam', |
| @@ -21,8 +25,9 @@ | ||
| 21 | 25 | 'orderby' => 'comment_date_gmt', |
| 22 | 26 | 'order' => 'DESC', |
| 23 | 27 | ) |
| 24 | 28 | ); |
| 29 | + | |
| 25 | 30 | if ( ! is_array( $spam_comments ) ) { |
| 26 | 31 | return false; |
| 27 | 32 | } |
| 28 | 33 | |