From 47e366f7e74953e05296968c525c737f73136c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Wed, 6 Mar 2019 12:12:05 +0100 Subject: [PATCH] unregisterPlugin: port old README docs to JSDoc --- packages/plugins/README.md | 7 +++++++ packages/plugins/src/api/index.js | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/packages/plugins/README.md b/packages/plugins/README.md index e9563c9368dc9f..06fcaeb8fc782d 100644 --- a/packages/plugins/README.md +++ b/packages/plugins/README.md @@ -102,6 +102,13 @@ registerPlugin( 'plugin-name', { Unregisters a plugin by name. +**Usage** + +```js +const { unregisterPlugin } = wp.plugins; +unregisterPlugin( 'plugin-name' ); +``` + **Parameters** - **name** `string`: Plugin name. diff --git a/packages/plugins/src/api/index.js b/packages/plugins/src/api/index.js index fb5aca2dddaf00..ce5ef7820a34d6 100644 --- a/packages/plugins/src/api/index.js +++ b/packages/plugins/src/api/index.js @@ -106,6 +106,12 @@ export function registerPlugin( name, settings ) { * * @param {string} name Plugin name. * + * @example + * ```js + * const { unregisterPlugin } = wp.plugins; + * unregisterPlugin( 'plugin-name' ); + * ``` + * * @return {?WPPlugin} The previous plugin settings object, if it has been * successfully unregistered; otherwise `undefined`. */