-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "remove unneeded UpdateSpamCount class"
This reverts commit 800c2ab.
- Loading branch information
1 parent
433107b
commit d45bbcb
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace AntispamBee\PostProcessors; | ||
|
||
use AntispamBee\GeneralOptions\Statistics; | ||
use AntispamBee\Helpers\Settings; | ||
|
||
/** | ||
* Post Processor that is responsible for incrementing the spam count and updating the value. | ||
*/ | ||
class UpdateSpamCount extends Base { | ||
|
||
protected static $slug = 'asb-update-spam-count'; | ||
|
||
public static function process( $item ) { | ||
if ( ! Settings::get_option( Statistics::get_option_name( Statistics::DASHBOARD_COUNT_OPTION ) ) ) { | ||
return $item; | ||
} | ||
|
||
Settings::update_option( | ||
'spam_count', | ||
intval( Settings::get_option( 'spam_count', '' ) + 1 ) | ||
); | ||
|
||
return $item; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters