Skip to content

Add support for "nag" noticesΒ #2

@stevegrunwell

Description

@stevegrunwell

There's a semi-official convention for handling "nag" notices (e.g. upsells, "Don't forget to rate the plugin", etc.) within WP Admin: the DISABLE_NAG_NOTICES constant.

When this constant is true, non-essential notices should be hidden (though it's entirely up to plugin authors to respect the user's choice).

It would be nice if the AdminNotice class exposed a method (perhaps with a better term than "nag"?) for marking these notices and automatically not rendering them if DISABLE_NAG_NOTICES is set, e.g.:

use StellarWP\AdminNotice\AdminNotice;

AdminNotice::factory("Don't forget to leave us a review on WordPress.org!")
    ->setPromotional(true)
    ->queue();

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions