@@ -732,12 +732,12 @@ public static function comment_query( $query ) {
732
732
/**
733
733
* Filter the comment status before it is set.
734
734
*
735
- * @param string $approved The approved comment status.
736
- * @param array $commentdata The comment data.
735
+ * @param int| string|\WP_Error $approved The approved comment status.
736
+ * @param array $comment_data The comment data.
737
737
*
738
- * @return boolean `true` if the comment is approved, `false` otherwise .
738
+ * @return int|string|\WP_Error The approval status. 1, 0, 'spam', 'trash', or WP_Error .
739
739
*/
740
- public static function pre_comment_approved ( $ approved , $ commentdata ) {
740
+ public static function pre_comment_approved ( $ approved , $ comment_data ) {
741
741
if ( $ approved || \is_wp_error ( $ approved ) ) {
742
742
return $ approved ;
743
743
}
@@ -747,16 +747,16 @@ public static function pre_comment_approved( $approved, $commentdata ) {
747
747
}
748
748
749
749
if (
750
- empty ( $ commentdata ['comment_meta ' ]['protocol ' ] ) ||
751
- 'activitypub ' !== $ commentdata ['comment_meta ' ]['protocol ' ]
750
+ empty ( $ comment_data ['comment_meta ' ]['protocol ' ] ) ||
751
+ 'activitypub ' !== $ comment_data ['comment_meta ' ]['protocol ' ]
752
752
) {
753
753
return $ approved ;
754
754
}
755
755
756
756
global $ wpdb ;
757
757
758
- $ author = $ commentdata ['comment_author ' ];
759
- $ author_url = $ commentdata ['comment_author_url ' ];
758
+ $ author = $ comment_data ['comment_author ' ];
759
+ $ author_url = $ comment_data ['comment_author_url ' ];
760
760
// phpcs:ignore
761
761
$ ok_to_comment = $ wpdb ->get_var ( $ wpdb ->prepare ( "SELECT comment_approved FROM $ wpdb ->comments WHERE comment_author = %s AND comment_author_url = %s and comment_approved = '1' LIMIT 1 " , $ author , $ author_url ) );
762
762
0 commit comments