FOUC - add body class .notices-auto-collect

Do not display notices before they are moved to panel.
This commit is contained in:
abuoyoyo 2022-07-16 21:42:51 +03:00
parent 2362cb37df
commit d48631c4f6
2 changed files with 12 additions and 0 deletions

View File

@ -36,6 +36,14 @@
}
/* This should only be used if auto-collect/above-title is enabled */
.notices-auto-collect #wpbody-content > div.updated,
.notices-auto-collect #wpbody-content > div.error,
.notices-auto-collect #wpbody-content > div.notice,
.notices-auto-collect #wpbody-content > div.update-nag,
.notices-auto-collect .wrap > div.updated,
.notices-auto-collect .wrap > div.error,
.notices-auto-collect .wrap > div.notice,
.notices-auto-collect .wrap > div.update-nag,
.notices-above-title .wrap > div.updated,
.notices-above-title .wrap > div.error,
.notices-above-title .wrap > div.notice,

View File

@ -31,6 +31,10 @@ class NoticeManager{
if ( ! empty( $this->options['screen_panel'] ) ){
add_action( 'admin_init' , [ $this , 'register_notice_manager_panel' ] );
if ( ! empty( $this->options['auto_collect'] ) ){
add_filter( 'admin_body_class', fn($classes) => $classes . ' notices-auto-collect' );
}
}else{
// array_walk($this->options,function(&$item){$item=0;});
}