FOUC - add body class .notices-above-title

Do not display notices before they are moved to new position.
This commit is contained in:
abuoyoyo 2022-07-17 18:18:45 +03:00
parent a2c3e60f87
commit 2362cb37df
2 changed files with 12 additions and 0 deletions

View File

@ -34,3 +34,11 @@
.notice_container > div.update-nag{ .notice_container > div.update-nag{
margin: 5px 12px 15px 12px !important; /* Override plugins custom css */ margin: 5px 12px 15px 12px !important; /* Override plugins custom css */
} }
/* This should only be used if auto-collect/above-title is enabled */
.notices-above-title .wrap > div.updated,
.notices-above-title .wrap > div.error,
.notices-above-title .wrap > div.notice,
.notices-above-title .wrap > div.update-nag{
display: none;
}

View File

@ -35,6 +35,10 @@ class NoticeManager{
// array_walk($this->options,function(&$item){$item=0;}); // array_walk($this->options,function(&$item){$item=0;});
} }
if ( ! empty( $this->options['above_title'] ) ){
add_filter( 'admin_body_class', fn($classes) => $classes . ' notices-above-title' );
}
} }
function admin_enqueues(){ function admin_enqueues(){