js - NoticeManager.getNoticesTopPriority()

This commit is contained in:
abuoyoyo 2022-07-16 22:30:41 +03:00
parent d48631c4f6
commit eabafb460f

View File

@ -123,6 +123,14 @@ var NoticeManager = (function ($, document) {
return {
getNotices: () => notices,
getNoticesTopPriority: () => {
if ( notices.filter('.error').length )
return 'error';
if ( notices.filter('.notice-warning, .update-nag').length )
return 'warning';
return 'notice';
},
/**
* Collect notices into panel.
* Remove dismiss-notices button.