Skip to content

Releases: stellarwp/admin-notices

2.0.0

20 Nov 00:45
Compare
Choose a tag to compare

What's Changed

Greatly improved custom notice designs

In #9 the method for creating custom notices was overhauled. Previously, there were methods for adding and removing "wrappers", however this was confusing and problematic. The main problem was that the way notices were positioned ended up still applying default WP styles, which the notice then had to fight. The wrapper concept was dropped entirely, replaced with two methods:

  • AdminNotice::custom() — tells the system this is a custom notice, which omits all standard styles and applies the necessary attributes to the custom markup provided
  • AdminNotice::location() — positions the notice on the page, using our own JS instead of relying on WP to position it. Note, by default the location is the standard notice location.

Conditionally enqueued scripts and stylesheets

In #10, we introduced a way for a notice to have a single script and stylesheet attached to it, such that those are loaded on the page only if the notice is set to display. This is handy as it takes all the fancy conditions this library introduced into consideration, avoiding unnecessary scripts and stylesheets.

  • AdminNotice::enqueueScript() — adds a JS script to be included when the notice displays
  • AdminNotice::enqueueStylesheet — adds a CSS stylesheet to be included when the notice displays

More information on all the new methods can be found in the updated README.

Breaking Changes

As mentioned, version 1.x used the idea of "wrappers" and such for trying to make custom notices. If you used the wrapper methods, this will break for you. You will need to update to using the new custom notice methods as part of updating.

Note: Standard notices should continue to work just fine and should be backwards-compatible.

Full Changelog: 1.2.2...2.0.0

1.2.2

29 Oct 21:19
219e081
Compare
Choose a tag to compare

What's Changed

  • Fix: user preferences retrieval in site with custom DB prefix by @maurisrx in #8

New Contributors

Full Changelog: 1.2.1...1.2.2

1.2.1

21 Oct 17:40
7dc21e6
Compare
Choose a tag to compare

What's Changed

  • Add .gitattributes by @defunctl in #5
  • Fix: Use strpos() instead of str_contains() for PHP 7.4 Compatibility by @d4mation in #7

New Contributors

Full Changelog: 1.2.0...1.2.1

1.2.0

17 Oct 18:32
Compare
Choose a tag to compare

What's Changed

  • Feature: Adds ability to set a notice as 'inline' by @stratease in #2
  • Feature: adds support for alternate WP styles by @JasonTheAdams in #3

New Contributors

Full Changelog: 1.1.0...1.2.0

1.1.0

16 Oct 19:42
e95e6d2
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 1.0.2...1.1.0

1.0.2

14 Oct 18:37
Compare
Choose a tag to compare

Full Changelog: 1.0.1...1.0.2

  • Fix: JS file versioning is switched to filemtime as Strauss removes the composer.json file 4150935

1.0.1

14 Oct 16:19
Compare
Choose a tag to compare

Initial public release! 🎉