: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @return The previous plugin settings object, if it has been
* successfully unregistered; otherwise `undefined`.
function unregisterPlugin(name) {
if (!api_plugins[name]) {
console.error('Plugin "' + name + '" is not registered.');
const oldPlugin = api_plugins[name];
delete api_plugins[name];
(0,external_wp_hooks_namespaceObject.doAction)('plugins.pluginUnregistered', oldPlugin, name);
* Returns a registered plugin settings.
* @param name Plugin name.
* @return Plugin setting.
function getPlugin(name) {
return api_plugins[name];
* Returns all registered plugins without a scope or for a given scope.
* @param scope The scope to be used when rendering inside
* a plugin area. No scope by default.
* @return The list of plugins without a scope or for a given scope.
function getPlugins(scope) {
return Object.values(api_plugins).filter(plugin => plugin.scope === scope);
;// CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/plugin-area/index.js
const getPluginContext = memize((icon, name) => ({
* A component that renders all plugin fills in a hidden div.
* var el = React.createElement;
* var PluginArea = wp.plugins.PluginArea;
* import { PluginArea } from '@wordpress/plugins';
* <PluginArea scope="my-page" />
* @return {Component} The component to be rendered.
const store = (0,external_wp_element_namespaceObject.useMemo)(() => {
(0,external_wp_hooks_namespaceObject.addAction)('plugins.pluginRegistered', 'core/plugins/plugin-area/plugins-registered', listener);
(0,external_wp_hooks_namespaceObject.addAction)('plugins.pluginUnregistered', 'core/plugins/plugin-area/plugins-unregistered', listener);
(0,external_wp_hooks_namespaceObject.removeAction)('plugins.pluginRegistered', 'core/plugins/plugin-area/plugins-registered');
(0,external_wp_hooks_namespaceObject.removeAction)('plugins.pluginUnregistered', 'core/plugins/plugin-area/plugins-unregistered');
const nextValue = getPlugins(scope);
if (!external_wp_isShallowEqual_default()(lastValue, nextValue)) {
const plugins = (0,external_wp_element_namespaceObject.useSyncExternalStore)(store.subscribe, store.getValue, store.getValue);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PluginContextProvider, {
value: getPluginContext(icon, name),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PluginErrorBoundary, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Plugin, {})
/* harmony default export */ const plugin_area = (PluginArea);
;// CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/index.js
;// CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/index.js
(window.wp = window.wp || {}).plugins = __webpack_exports__;