diff --git a/includes/trait-bulk-actions.php b/includes/trait-bulk-actions.php index f262c55c6eb4d5c72bc980c686e2ec110f85f9c4..74fd489e9923484054ab6220f0407abf8d7fc86c 100644 --- a/includes/trait-bulk-actions.php +++ b/includes/trait-bulk-actions.php @@ -18,11 +18,25 @@ trait Bulk_Actions { add_action( 'admin_notices', array( __CLASS__, 'admin_notices' ) ); add_filter( 'posts_where', array( __CLASS__, 'hide_posts' ), 999, 2 ); + add_filter( 'removable_query_args', array( __CLASS__, 'remove_notice_arg' ) ); + self::register_extra_hooks(); } /** - * + * Some methods may need extra hooks */ public static function register_extra_hooks() {} + + /** + * Strip the custom notice key, otherwise it turns up in pagination and other unwanted places. + * + * @param array $args Array of one-time query args + * @return array + */ + public static function remove_notice_arg( $args ) { + $args[] = self::ADMIN_NOTICE_KEY; + + return $args; + } }