Skip to content
Snippets Groups Projects
Commit 9d51824a authored by Erick Hitter's avatar Erick Hitter
Browse files

Keep the notice keys out of pagination and such

parent 6b81fe15
Branches
Tags
No related merge requests found
......@@ -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;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment