diff --git a/includes/class-delete-permanently.php b/includes/class-delete-permanently.php index f80185584bc37eb2e13d3a8c26b459463a95762d..5d989b4bb794aee625dc54f288c07a145e6eacbf 100644 --- a/includes/class-delete-permanently.php +++ b/includes/class-delete-permanently.php @@ -12,22 +12,16 @@ namespace Automattic\WP\Bulk_Actions_Cron_Offload; */ class Delete_Permanently { /** - * Class constants + * Common hooks and such */ - const ACTION = 'delete'; - - const ADMIN_NOTICE_KEY = 'bulk_actions_cron_offload_delete_permanently'; + use Bulk_Actions; /** - * Register this bulk process' hooks + * Class constants */ - public static function register_hooks() { - add_action( Main::build_hook( self::ACTION ), array( __CLASS__, 'process' ) ); - add_action( Main::build_cron_hook( self::ACTION ), array( __CLASS__, 'process_via_cron' ) ); + const ACTION = 'delete'; - add_action( 'admin_notices', array( __CLASS__, 'admin_notices' ) ); - add_filter( 'posts_where', array( __CLASS__, 'hide_posts' ), 999, 2 ); - } + const ADMIN_NOTICE_KEY = 'bulk_actions_cron_offload_delete_permanently'; /** * Handle a request to delete selected posts from the trash diff --git a/includes/class-edit.php b/includes/class-edit.php index 522eace4ffd677886d42f6e3d11913eaea7e5b81..2e7ce48a9a558027be02f97ee337c4e0208b45c1 100644 --- a/includes/class-edit.php +++ b/includes/class-edit.php @@ -12,22 +12,16 @@ namespace Automattic\WP\Bulk_Actions_Cron_Offload; */ class Edit { /** - * Class constants + * Common hooks and such */ - const ACTION = 'edit'; - - const ADMIN_NOTICE_KEY = 'bulk_actions_cron_offload_edit'; + use Bulk_Actions; /** - * Register this bulk process' hooks + * Class constants */ - public static function register_hooks() { - add_action( Main::build_hook( self::ACTION ), array( __CLASS__, 'process' ) ); - add_action( Main::build_cron_hook( self::ACTION ), array( __CLASS__, 'process_via_cron' ) ); + const ACTION = 'edit'; - add_action( 'admin_notices', array( __CLASS__, 'admin_notices' ) ); - add_filter( 'posts_where', array( __CLASS__, 'hide_posts' ), 999, 2 ); - } + const ADMIN_NOTICE_KEY = 'bulk_actions_cron_offload_edit'; /** * Handle a request to edit some posts diff --git a/includes/class-move-to-trash.php b/includes/class-move-to-trash.php index 2a9f78634b54425dc3e1393d82df75510680151b..51d60b165babd8b595ffd0dd93b465a198f3b713 100644 --- a/includes/class-move-to-trash.php +++ b/includes/class-move-to-trash.php @@ -12,22 +12,16 @@ namespace Automattic\WP\Bulk_Actions_Cron_Offload; */ class Move_To_Trash { /** - * Class constants + * Common hooks and such */ - const ACTION = 'trash'; - - const ADMIN_NOTICE_KEY = 'bulk_actions_cron_offload_move_to_trash'; + use Bulk_Actions; /** - * Register this bulk process' hooks + * Class constants */ - public static function register_hooks() { - add_action( Main::build_hook( self::ACTION ), array( __CLASS__, 'process' ) ); - add_action( Main::build_cron_hook( self::ACTION ), array( __CLASS__, 'process_via_cron' ) ); + const ACTION = 'trash'; - add_action( 'admin_notices', array( __CLASS__, 'admin_notices' ) ); - add_filter( 'posts_where', array( __CLASS__, 'hide_posts' ), 999, 2 ); - } + const ADMIN_NOTICE_KEY = 'bulk_actions_cron_offload_move_to_trash'; /** * Handle a request to move some posts to the trash diff --git a/includes/class-restore-from-trash.php b/includes/class-restore-from-trash.php index 59ccbe4cd678d2fe3ea7c2fbcb3dabf08c51b7a1..2b982bef2e7028cbaf6ccd6a38a38c3becf06fbc 100644 --- a/includes/class-restore-from-trash.php +++ b/includes/class-restore-from-trash.php @@ -12,22 +12,16 @@ namespace Automattic\WP\Bulk_Actions_Cron_Offload; */ class Restore_From_Trash { /** - * Class constants + * Common hooks and such */ - const ACTION = 'untrash'; - - const ADMIN_NOTICE_KEY = 'bulk_actions_cron_offload_restore_from_trash'; + use Bulk_Actions; /** - * Register this bulk process' hooks + * Class constants */ - public static function register_hooks() { - add_action( Main::build_hook( self::ACTION ), array( __CLASS__, 'process' ) ); - add_action( Main::build_cron_hook( self::ACTION ), array( __CLASS__, 'process_via_cron' ) ); + const ACTION = 'untrash'; - add_action( 'admin_notices', array( __CLASS__, 'admin_notices' ) ); - add_filter( 'posts_where', array( __CLASS__, 'hide_posts' ), 999, 2 ); - } + const ADMIN_NOTICE_KEY = 'bulk_actions_cron_offload_restore_from_trash'; /** * Handle a request to restore some posts from the trash