Skip to content

Commit

Permalink
chore: mark old ASB rules as »legacy« in spam reason select instead o…
Browse files Browse the repository at this point in the history
…f »unknown«
  • Loading branch information
florianbrinkmann committed Oct 18, 2023
1 parent fbe140e commit 2d5c21e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Helpers/SpamReasonTextHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,18 @@ public static function get_texts_by_slugs( array $slugs ) {
continue;
}

// @todo: don’t mark our old rules as »unknown« but »legacy«
$legacy_rules = [
'server' => esc_html_x( 'Fake IP', 'legacy spam reason label', 'antispam-bee' )
];
if ( array_key_exists( $slug, $legacy_rules ) ) {
$texts[] = esc_html_x(
/* translators: s=slug of unknown spam reason */
sprintf( 'Legacy rule: %s', $legacy_rules[ $slug ] ),
'spam-reason-legacy-text',
'antispam-bee'
);
continue;
}
$texts[] = esc_html_x(
/* translators: s=slug of unknown spam reason */
sprintf( 'Unknown rule: %s', $slug ),
Expand Down

0 comments on commit 2d5c21e

Please sign in to comment.