Skip to content

Commit

Permalink
Add akismet key to CF7.
Browse files Browse the repository at this point in the history
  • Loading branch information
kagg-design committed Oct 15, 2024
1 parent 3cd1e1c commit e70954b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/php/CF7/CF7.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ protected function add_form_id_to_cf7_hcap_shortcode( string $output, int $form_
}

$cf7_hcap_sc = preg_replace(
[ '/\s*\[|]\s*/', '/(id|class)\s*:\s*([\w-]+)/' ],
[ '/\s*\[|]\s*/', '/(id|class|akismet)\s*:\s*([\w-]+)/' ],
[ '', '$1=$2' ],
$cf7_hcap_shortcode
);
Expand All @@ -354,7 +354,7 @@ protected function add_form_id_to_cf7_hcap_shortcode( string $output, int $form_
array_walk(
$atts,
static function ( &$value, $key ) {
if ( in_array( $key, [ 'id', 'class' ], true ) ) {
if ( in_array( $key, [ 'id', 'class', 'akismet' ], true ) ) {
$value = "$key:$value";

return;
Expand Down

0 comments on commit e70954b

Please sign in to comment.