Download the PHP package julien731/wp-dismissible-notices-handler without Composer

On this page you can find all versions of the php package julien731/wp-dismissible-notices-handler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-dismissible-notices-handler

WordPress Dismissible Notices Handler

Scrutinizer Code Quality

Since version 4.2, WordPress has a built-in mechanism for handling dismissible admin notices. While this mechanism handles dismissing notices, the dismissal isn't persistent. This means that a user would see the notice on every page load, even though he or she dismissed the notice already.

What the Dismissible Notices Handler (DNH) library does is handle the persistent part of dismissing admin notices.

How It Works

The DNH library is extremely simple to use and yet has a couple of advanced options.

The basics of it is to register a new admin notice. You really need 3 things for registering a notice:

There is a handy helper function available for notice registration: dnh_register_notice()

This function takes 4 parameters:

Installation

The simpest way to use DNH is to add it as a Composer dependency:

Example

Registering an admin notice would look like that:

Advanced Parameters

The function takes an array of optional parameters allowing more control over the notices and how they're dismissed. Only 3 parameters are available so far but hopefully more will be coming soon.

Hereafter is the list of available parameters to be passed in the $args array. Please note that the $args parameter is optional.

Parameter Possible Value(s) Default Description
scope user, global user Whether the notice should be dismissed for the current user only or globally on the site. A notice dismissed for a user will still show up for other users, while a notice dismissed globally will not be displayed anymore after being dismissed once.
cap Any WordPress capability If not empty, the handler will check if the current user has the specified before displaying the notice.
class string Additional class to add to the notice wrapper

All versions of wp-dismissible-notices-handler with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package julien731/wp-dismissible-notices-handler contains the following files

Loading the files please wait ....