Give 1.8.14 – Give_Notices Class Update

In Give version 1.8.9 we introduced the Notices API. In release 1.8.14 we are adding improvements to the API so that you can create non-dismissible notice without a close icon appearing [Read]. This type of notice should only be used for very important messages, like blockers, such as database updates and missing dependancies.

Here is a general code example to create a notice with the Give_Notices API:

Give()->notices->register_notice(array(
    'id' => '' // Value: unique notice id
    'type' => '' // Value: error/warning/success/info/updated
    'description' => '' // Value: notice message content
    'dismissible' => '' // Value: auto/true/false. if set to true then notice will auto class in 5 seconds
    'dismissible_type' => '' // Value: null/user/all
    'dismiss_interval' => '' // Value shortly/permanent/custom
    'dismiss_interval_time' => '' // Value: time interval in seconds (only need if dismiss_interval set to custom)
));

[Read]

If you want to create non-dismissible notice without close icon set dismissible to false.

Non dismissible notices without close icon

In addition to the new non-dismissible notice enhancement we have deprecated the auto-dismissible parameter for simply dismissible with backward compatibility.

We’re also working to create inline notices and other additional notice enhancements in the future so stay tuned!

 

Ravinder Kumar

Open source lover, the father of a daughter, continually improving developer, and Senior WordPress Engineer at GiveWP.

 

Leave a Comment