/single-use-widget

Proof of concept for a WordPress widget that can only be used once in all registered sidebars.

Primary LanguagePHP

Single Use Widget

Proof of concept for a single-use WordPress widget

Notes:

  • Any use in any registered sidebar will disable the widget globally.
  • Only works in the Customizer, not on Widget admin page.
  • Proof concept. NOT SAFE FOR PRODUCTION.

Credits

The main functionality (i.e. JavaScript) was kindly shared by @krafter on WordPress StackExchange.