array( 'notice-error', 'error' ), 'warning' => array( 'notice-warning' ), 'success' => array( 'notice-success', 'updated' ), 'info' => array( 'notice-info' ), ); /** * Classes that mark a notice as intentionally page-local — WordPress * core's own admin-notice relocation (wp-admin/js/common.js) skips * these, and so do we, for the same reason: an `.inline` notice is * meant to stay exactly where its plugin placed it (e.g. next to a * specific list-table row), not be swept into a global collector. */ const NOTICE_EXCLUDE_CLASSES = array( 'inline', 'below-h2' ); // ------------------------------------------------------------------------- // Demo notices // ------------------------------------------------------------------------- /** * Query arg that, when present and nonce-verified on this plugin's own * page, triggers a one-off batch of fake notices covering every * severity tab. Never persisted — only affects the single page load * that carries this arg. */ const DEMO_QUERY_ARG = 'aamo_ng_demo'; const DEMO_NONCE_ACTION = 'aamo_ng_demo_notices'; // ------------------------------------------------------------------------- // Notice Collector — display style // ------------------------------------------------------------------------- /** Persisted option holding the admin's chosen display style. */ const OPTION_DISPLAY_STYLE = 'aamo_ng_display_style'; const STYLE_TABBED = 'tabbed'; const STYLE_ACCORDION = 'accordion'; const STYLE_GRID = 'grid'; /** Every allowed display-style value, in the order shown on the settings page. */ const DISPLAY_STYLES = array( self::STYLE_TABBED, self::STYLE_ACCORDION, self::STYLE_GRID, ); /** admin_post_ hook suffix and nonce action for saving the settings form (display style + minimum group count). */ const SAVE_SETTINGS_ACTION = 'aamo_ng_save_settings'; /** Query arg set on the redirect back after a successful save. */ const SETTINGS_SAVED_QUERY_ARG = 'aamo_ng_settings_saved'; // ------------------------------------------------------------------------- // Notice Collector — minimum group count // ------------------------------------------------------------------------- /** * Persisted option holding the minimum number of notices that must be * present on a page before the Notice Collector groups them into a * card. Below this count, notices are left exactly where WordPress * core's own relocation shim placed them — collapsing just one or two * notices into a card isn't worth the extra click. */ const OPTION_MIN_GROUP_COUNT = 'aamo_ng_min_group_count'; const MIN_GROUP_COUNT_DEFAULT = 3; /** Every allowed minimum-group-count value, in display order. */ const MIN_GROUP_COUNT_OPTIONS = array( 2, 3, 4, 5 ); // ------------------------------------------------------------------------- // Notice Collector — default open/closed state // ------------------------------------------------------------------------- /** Persisted option: whether the Notice Collector starts collapsed on page load. */ const OPTION_COLLAPSED_BY_DEFAULT = 'aamo_ng_collapsed_by_default'; }