Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: plugins.js
this["wp"] = this["wp"] || {}; this["wp"]["plugins"] =
[0] Fix | Delete
/******/ (function(modules) { // webpackBootstrap
[1] Fix | Delete
/******/ // The module cache
[2] Fix | Delete
/******/ var installedModules = {};
[3] Fix | Delete
/******/
[4] Fix | Delete
/******/ // The require function
[5] Fix | Delete
/******/ function __webpack_require__(moduleId) {
[6] Fix | Delete
/******/
[7] Fix | Delete
/******/ // Check if module is in cache
[8] Fix | Delete
/******/ if(installedModules[moduleId]) {
[9] Fix | Delete
/******/ return installedModules[moduleId].exports;
[10] Fix | Delete
/******/ }
[11] Fix | Delete
/******/ // Create a new module (and put it into the cache)
[12] Fix | Delete
/******/ var module = installedModules[moduleId] = {
[13] Fix | Delete
/******/ i: moduleId,
[14] Fix | Delete
/******/ l: false,
[15] Fix | Delete
/******/ exports: {}
[16] Fix | Delete
/******/ };
[17] Fix | Delete
/******/
[18] Fix | Delete
/******/ // Execute the module function
[19] Fix | Delete
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
[20] Fix | Delete
/******/
[21] Fix | Delete
/******/ // Flag the module as loaded
[22] Fix | Delete
/******/ module.l = true;
[23] Fix | Delete
/******/
[24] Fix | Delete
/******/ // Return the exports of the module
[25] Fix | Delete
/******/ return module.exports;
[26] Fix | Delete
/******/ }
[27] Fix | Delete
/******/
[28] Fix | Delete
/******/
[29] Fix | Delete
/******/ // expose the modules object (__webpack_modules__)
[30] Fix | Delete
/******/ __webpack_require__.m = modules;
[31] Fix | Delete
/******/
[32] Fix | Delete
/******/ // expose the module cache
[33] Fix | Delete
/******/ __webpack_require__.c = installedModules;
[34] Fix | Delete
/******/
[35] Fix | Delete
/******/ // define getter function for harmony exports
[36] Fix | Delete
/******/ __webpack_require__.d = function(exports, name, getter) {
[37] Fix | Delete
/******/ if(!__webpack_require__.o(exports, name)) {
[38] Fix | Delete
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
[39] Fix | Delete
/******/ }
[40] Fix | Delete
/******/ };
[41] Fix | Delete
/******/
[42] Fix | Delete
/******/ // define __esModule on exports
[43] Fix | Delete
/******/ __webpack_require__.r = function(exports) {
[44] Fix | Delete
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
[45] Fix | Delete
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
[46] Fix | Delete
/******/ }
[47] Fix | Delete
/******/ Object.defineProperty(exports, '__esModule', { value: true });
[48] Fix | Delete
/******/ };
[49] Fix | Delete
/******/
[50] Fix | Delete
/******/ // create a fake namespace object
[51] Fix | Delete
/******/ // mode & 1: value is a module id, require it
[52] Fix | Delete
/******/ // mode & 2: merge all properties of value into the ns
[53] Fix | Delete
/******/ // mode & 4: return value when already ns object
[54] Fix | Delete
/******/ // mode & 8|1: behave like require
[55] Fix | Delete
/******/ __webpack_require__.t = function(value, mode) {
[56] Fix | Delete
/******/ if(mode & 1) value = __webpack_require__(value);
[57] Fix | Delete
/******/ if(mode & 8) return value;
[58] Fix | Delete
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
[59] Fix | Delete
/******/ var ns = Object.create(null);
[60] Fix | Delete
/******/ __webpack_require__.r(ns);
[61] Fix | Delete
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
[62] Fix | Delete
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
[63] Fix | Delete
/******/ return ns;
[64] Fix | Delete
/******/ };
[65] Fix | Delete
/******/
[66] Fix | Delete
/******/ // getDefaultExport function for compatibility with non-harmony modules
[67] Fix | Delete
/******/ __webpack_require__.n = function(module) {
[68] Fix | Delete
/******/ var getter = module && module.__esModule ?
[69] Fix | Delete
/******/ function getDefault() { return module['default']; } :
[70] Fix | Delete
/******/ function getModuleExports() { return module; };
[71] Fix | Delete
/******/ __webpack_require__.d(getter, 'a', getter);
[72] Fix | Delete
/******/ return getter;
[73] Fix | Delete
/******/ };
[74] Fix | Delete
/******/
[75] Fix | Delete
/******/ // Object.prototype.hasOwnProperty.call
[76] Fix | Delete
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
[77] Fix | Delete
/******/
[78] Fix | Delete
/******/ // __webpack_public_path__
[79] Fix | Delete
/******/ __webpack_require__.p = "";
[80] Fix | Delete
/******/
[81] Fix | Delete
/******/
[82] Fix | Delete
/******/ // Load entry module and return exports
[83] Fix | Delete
/******/ return __webpack_require__(__webpack_require__.s = "ey5A");
[84] Fix | Delete
/******/ })
[85] Fix | Delete
/************************************************************************/
[86] Fix | Delete
/******/ ({
[87] Fix | Delete
[88] Fix | Delete
/***/ "1OyB":
[89] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[90] Fix | Delete
[91] Fix | Delete
"use strict";
[92] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
[93] Fix | Delete
function _classCallCheck(instance, Constructor) {
[94] Fix | Delete
if (!(instance instanceof Constructor)) {
[95] Fix | Delete
throw new TypeError("Cannot call a class as a function");
[96] Fix | Delete
}
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
/***/ }),
[100] Fix | Delete
[101] Fix | Delete
/***/ "GRId":
[102] Fix | Delete
/***/ (function(module, exports) {
[103] Fix | Delete
[104] Fix | Delete
(function() { module.exports = window["wp"]["element"]; }());
[105] Fix | Delete
[106] Fix | Delete
/***/ }),
[107] Fix | Delete
[108] Fix | Delete
/***/ "JX7q":
[109] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[110] Fix | Delete
[111] Fix | Delete
"use strict";
[112] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; });
[113] Fix | Delete
function _assertThisInitialized(self) {
[114] Fix | Delete
if (self === void 0) {
[115] Fix | Delete
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
[116] Fix | Delete
}
[117] Fix | Delete
[118] Fix | Delete
return self;
[119] Fix | Delete
}
[120] Fix | Delete
[121] Fix | Delete
/***/ }),
[122] Fix | Delete
[123] Fix | Delete
/***/ "Ji7U":
[124] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[125] Fix | Delete
[126] Fix | Delete
"use strict";
[127] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inherits; });
[128] Fix | Delete
/* harmony import */ var _babel_runtime_helpers_esm_setPrototypeOf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("s4An");
[129] Fix | Delete
[130] Fix | Delete
function _inherits(subClass, superClass) {
[131] Fix | Delete
if (typeof superClass !== "function" && superClass !== null) {
[132] Fix | Delete
throw new TypeError("Super expression must either be null or a function");
[133] Fix | Delete
}
[134] Fix | Delete
[135] Fix | Delete
subClass.prototype = Object.create(superClass && superClass.prototype, {
[136] Fix | Delete
constructor: {
[137] Fix | Delete
value: subClass,
[138] Fix | Delete
writable: true,
[139] Fix | Delete
configurable: true
[140] Fix | Delete
}
[141] Fix | Delete
});
[142] Fix | Delete
if (superClass) Object(_babel_runtime_helpers_esm_setPrototypeOf__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(subClass, superClass);
[143] Fix | Delete
}
[144] Fix | Delete
[145] Fix | Delete
/***/ }),
[146] Fix | Delete
[147] Fix | Delete
/***/ "K9lf":
[148] Fix | Delete
/***/ (function(module, exports) {
[149] Fix | Delete
[150] Fix | Delete
(function() { module.exports = window["wp"]["compose"]; }());
[151] Fix | Delete
[152] Fix | Delete
/***/ }),
[153] Fix | Delete
[154] Fix | Delete
/***/ "Tqx9":
[155] Fix | Delete
/***/ (function(module, exports) {
[156] Fix | Delete
[157] Fix | Delete
(function() { module.exports = window["wp"]["primitives"]; }());
[158] Fix | Delete
[159] Fix | Delete
/***/ }),
[160] Fix | Delete
[161] Fix | Delete
/***/ "U8pU":
[162] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[163] Fix | Delete
[164] Fix | Delete
"use strict";
[165] Fix | Delete
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
[166] Fix | Delete
function _typeof(obj) {
[167] Fix | Delete
"@babel/helpers - typeof";
[168] Fix | Delete
[169] Fix | Delete
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
[170] Fix | Delete
_typeof = function _typeof(obj) {
[171] Fix | Delete
return typeof obj;
[172] Fix | Delete
};
[173] Fix | Delete
} else {
[174] Fix | Delete
_typeof = function _typeof(obj) {
[175] Fix | Delete
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
[176] Fix | Delete
};
[177] Fix | Delete
}
[178] Fix | Delete
[179] Fix | Delete
return _typeof(obj);
[180] Fix | Delete
}
[181] Fix | Delete
[182] Fix | Delete
/***/ }),
[183] Fix | Delete
[184] Fix | Delete
/***/ "YLtl":
[185] Fix | Delete
/***/ (function(module, exports) {
[186] Fix | Delete
[187] Fix | Delete
(function() { module.exports = window["lodash"]; }());
[188] Fix | Delete
[189] Fix | Delete
/***/ }),
[190] Fix | Delete
[191] Fix | Delete
/***/ "ey5A":
[192] Fix | Delete
/***/ (function(module, __webpack_exports__, __webpack_require__) {
[193] Fix | Delete
[194] Fix | Delete
"use strict";
[195] Fix | Delete
// ESM COMPAT FLAG
[196] Fix | Delete
__webpack_require__.r(__webpack_exports__);
[197] Fix | Delete
[198] Fix | Delete
// EXPORTS
[199] Fix | Delete
__webpack_require__.d(__webpack_exports__, "PluginArea", function() { return /* reexport */ plugin_area; });
[200] Fix | Delete
__webpack_require__.d(__webpack_exports__, "withPluginContext", function() { return /* reexport */ plugin_context_withPluginContext; });
[201] Fix | Delete
__webpack_require__.d(__webpack_exports__, "registerPlugin", function() { return /* reexport */ registerPlugin; });
[202] Fix | Delete
__webpack_require__.d(__webpack_exports__, "unregisterPlugin", function() { return /* reexport */ unregisterPlugin; });
[203] Fix | Delete
__webpack_require__.d(__webpack_exports__, "getPlugin", function() { return /* reexport */ getPlugin; });
[204] Fix | Delete
__webpack_require__.d(__webpack_exports__, "getPlugins", function() { return /* reexport */ getPlugins; });
[205] Fix | Delete
[206] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
[207] Fix | Delete
var classCallCheck = __webpack_require__("1OyB");
[208] Fix | Delete
[209] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
[210] Fix | Delete
var createClass = __webpack_require__("vuIU");
[211] Fix | Delete
[212] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
[213] Fix | Delete
var assertThisInitialized = __webpack_require__("JX7q");
[214] Fix | Delete
[215] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
[216] Fix | Delete
var inherits = __webpack_require__("Ji7U");
[217] Fix | Delete
[218] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
[219] Fix | Delete
var possibleConstructorReturn = __webpack_require__("md7G");
[220] Fix | Delete
[221] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
[222] Fix | Delete
var getPrototypeOf = __webpack_require__("foSv");
[223] Fix | Delete
[224] Fix | Delete
// EXTERNAL MODULE: external ["wp","element"]
[225] Fix | Delete
var external_wp_element_ = __webpack_require__("GRId");
[226] Fix | Delete
[227] Fix | Delete
// EXTERNAL MODULE: external "lodash"
[228] Fix | Delete
var external_lodash_ = __webpack_require__("YLtl");
[229] Fix | Delete
[230] Fix | Delete
// EXTERNAL MODULE: external ["wp","hooks"]
[231] Fix | Delete
var external_wp_hooks_ = __webpack_require__("g56x");
[232] Fix | Delete
[233] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
[234] Fix | Delete
var esm_extends = __webpack_require__("wx14");
[235] Fix | Delete
[236] Fix | Delete
// EXTERNAL MODULE: external ["wp","compose"]
[237] Fix | Delete
var external_wp_compose_ = __webpack_require__("K9lf");
[238] Fix | Delete
[239] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/components/plugin-context/index.js
[240] Fix | Delete
[241] Fix | Delete
[242] Fix | Delete
[243] Fix | Delete
/**
[244] Fix | Delete
* WordPress dependencies
[245] Fix | Delete
*/
[246] Fix | Delete
[247] Fix | Delete
[248] Fix | Delete
[249] Fix | Delete
var _createContext = Object(external_wp_element_["createContext"])({
[250] Fix | Delete
name: null,
[251] Fix | Delete
icon: null
[252] Fix | Delete
}),
[253] Fix | Delete
Consumer = _createContext.Consumer,
[254] Fix | Delete
Provider = _createContext.Provider;
[255] Fix | Delete
[256] Fix | Delete
[257] Fix | Delete
/**
[258] Fix | Delete
* A Higher Order Component used to inject Plugin context to the
[259] Fix | Delete
* wrapped component.
[260] Fix | Delete
*
[261] Fix | Delete
* @param {Function} mapContextToProps Function called on every context change,
[262] Fix | Delete
* expected to return object of props to
[263] Fix | Delete
* merge with the component's own props.
[264] Fix | Delete
*
[265] Fix | Delete
* @return {WPComponent} Enhanced component with injected context as props.
[266] Fix | Delete
*/
[267] Fix | Delete
[268] Fix | Delete
var plugin_context_withPluginContext = function withPluginContext(mapContextToProps) {
[269] Fix | Delete
return Object(external_wp_compose_["createHigherOrderComponent"])(function (OriginalComponent) {
[270] Fix | Delete
return function (props) {
[271] Fix | Delete
return Object(external_wp_element_["createElement"])(Consumer, null, function (context) {
[272] Fix | Delete
return Object(external_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({}, props, mapContextToProps(context, props)));
[273] Fix | Delete
});
[274] Fix | Delete
};
[275] Fix | Delete
}, 'withPluginContext');
[276] Fix | Delete
};
[277] Fix | Delete
[278] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
[279] Fix | Delete
var defineProperty = __webpack_require__("rePB");
[280] Fix | Delete
[281] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
[282] Fix | Delete
var esm_typeof = __webpack_require__("U8pU");
[283] Fix | Delete
[284] Fix | Delete
// EXTERNAL MODULE: external ["wp","primitives"]
[285] Fix | Delete
var external_wp_primitives_ = __webpack_require__("Tqx9");
[286] Fix | Delete
[287] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/plugins.js
[288] Fix | Delete
[289] Fix | Delete
[290] Fix | Delete
/**
[291] Fix | Delete
* WordPress dependencies
[292] Fix | Delete
*/
[293] Fix | Delete
[294] Fix | Delete
var plugins = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
[295] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[296] Fix | Delete
viewBox: "0 0 24 24"
[297] Fix | Delete
}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
[298] Fix | Delete
d: "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"
[299] Fix | Delete
}));
[300] Fix | Delete
/* harmony default export */ var library_plugins = (plugins);
[301] Fix | Delete
[302] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/plugins/build-module/api/index.js
[303] Fix | Delete
[304] Fix | Delete
[305] Fix | Delete
[306] Fix | Delete
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
[307] Fix | Delete
[308] Fix | Delete
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
[309] Fix | Delete
[310] Fix | Delete
/* eslint no-console: [ 'error', { allow: [ 'error' ] } ] */
[311] Fix | Delete
[312] Fix | Delete
/**
[313] Fix | Delete
* WordPress dependencies
[314] Fix | Delete
*/
[315] Fix | Delete
[316] Fix | Delete
[317] Fix | Delete
/**
[318] Fix | Delete
* External dependencies
[319] Fix | Delete
*/
[320] Fix | Delete
[321] Fix | Delete
[322] Fix | Delete
/**
[323] Fix | Delete
* Defined behavior of a plugin type.
[324] Fix | Delete
*
[325] Fix | Delete
* @typedef {Object} WPPlugin
[326] Fix | Delete
*
[327] Fix | Delete
* @property {string} name A string identifying the plugin. Must be
[328] Fix | Delete
* unique across all registered plugins.
[329] Fix | Delete
* unique across all registered plugins.
[330] Fix | Delete
* @property {string|WPElement|Function} icon An icon to be shown in the UI. It can
[331] Fix | Delete
* be a slug of the Dashicon, or an element
[332] Fix | Delete
* (or function returning an element) if you
[333] Fix | Delete
* choose to render your own SVG.
[334] Fix | Delete
* @property {Function} render A component containing the UI elements
[335] Fix | Delete
* to be rendered.
[336] Fix | Delete
*/
[337] Fix | Delete
[338] Fix | Delete
/**
[339] Fix | Delete
* Plugin definitions keyed by plugin name.
[340] Fix | Delete
*
[341] Fix | Delete
* @type {Object.<string,WPPlugin>}
[342] Fix | Delete
*/
[343] Fix | Delete
[344] Fix | Delete
var api_plugins = {};
[345] Fix | Delete
/**
[346] Fix | Delete
* Registers a plugin to the editor.
[347] Fix | Delete
*
[348] Fix | Delete
* @param {string} name A string identifying the plugin.Must be
[349] Fix | Delete
* unique across all registered plugins.
[350] Fix | Delete
* @param {WPPlugin} settings The settings for this plugin.
[351] Fix | Delete
*
[352] Fix | Delete
* @example
[353] Fix | Delete
* <caption>ES5</caption>
[354] Fix | Delete
* ```js
[355] Fix | Delete
* // Using ES5 syntax
[356] Fix | Delete
* var el = wp.element.createElement;
[357] Fix | Delete
* var Fragment = wp.element.Fragment;
[358] Fix | Delete
* var PluginSidebar = wp.editPost.PluginSidebar;
[359] Fix | Delete
* var PluginSidebarMoreMenuItem = wp.editPost.PluginSidebarMoreMenuItem;
[360] Fix | Delete
* var registerPlugin = wp.plugins.registerPlugin;
[361] Fix | Delete
* var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
[362] Fix | Delete
*
[363] Fix | Delete
* function Component() {
[364] Fix | Delete
* return el(
[365] Fix | Delete
* Fragment,
[366] Fix | Delete
* {},
[367] Fix | Delete
* el(
[368] Fix | Delete
* PluginSidebarMoreMenuItem,
[369] Fix | Delete
* {
[370] Fix | Delete
* target: 'sidebar-name',
[371] Fix | Delete
* },
[372] Fix | Delete
* 'My Sidebar'
[373] Fix | Delete
* ),
[374] Fix | Delete
* el(
[375] Fix | Delete
* PluginSidebar,
[376] Fix | Delete
* {
[377] Fix | Delete
* name: 'sidebar-name',
[378] Fix | Delete
* title: 'My Sidebar',
[379] Fix | Delete
* },
[380] Fix | Delete
* 'Content of the sidebar'
[381] Fix | Delete
* )
[382] Fix | Delete
* );
[383] Fix | Delete
* }
[384] Fix | Delete
* registerPlugin( 'plugin-name', {
[385] Fix | Delete
* icon: moreIcon,
[386] Fix | Delete
* render: Component,
[387] Fix | Delete
* } );
[388] Fix | Delete
* ```
[389] Fix | Delete
*
[390] Fix | Delete
* @example
[391] Fix | Delete
* <caption>ESNext</caption>
[392] Fix | Delete
* ```js
[393] Fix | Delete
* // Using ESNext syntax
[394] Fix | Delete
* import { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/edit-post';
[395] Fix | Delete
* import { registerPlugin } from '@wordpress/plugins';
[396] Fix | Delete
* import { more } from '@wordpress/icons';
[397] Fix | Delete
*
[398] Fix | Delete
* const Component = () => (
[399] Fix | Delete
* <>
[400] Fix | Delete
* <PluginSidebarMoreMenuItem
[401] Fix | Delete
* target="sidebar-name"
[402] Fix | Delete
* >
[403] Fix | Delete
* My Sidebar
[404] Fix | Delete
* </PluginSidebarMoreMenuItem>
[405] Fix | Delete
* <PluginSidebar
[406] Fix | Delete
* name="sidebar-name"
[407] Fix | Delete
* title="My Sidebar"
[408] Fix | Delete
* >
[409] Fix | Delete
* Content of the sidebar
[410] Fix | Delete
* </PluginSidebar>
[411] Fix | Delete
* </>
[412] Fix | Delete
* );
[413] Fix | Delete
*
[414] Fix | Delete
* registerPlugin( 'plugin-name', {
[415] Fix | Delete
* icon: more,
[416] Fix | Delete
* render: Component,
[417] Fix | Delete
* } );
[418] Fix | Delete
* ```
[419] Fix | Delete
*
[420] Fix | Delete
* @return {WPPlugin} The final plugin settings object.
[421] Fix | Delete
*/
[422] Fix | Delete
[423] Fix | Delete
function registerPlugin(name, settings) {
[424] Fix | Delete
if (Object(esm_typeof["a" /* default */])(settings) !== 'object') {
[425] Fix | Delete
console.error('No settings object provided!');
[426] Fix | Delete
return null;
[427] Fix | Delete
}
[428] Fix | Delete
[429] Fix | Delete
if (typeof name !== 'string') {
[430] Fix | Delete
console.error('Plugin names must be strings.');
[431] Fix | Delete
return null;
[432] Fix | Delete
}
[433] Fix | Delete
[434] Fix | Delete
if (!/^[a-z][a-z0-9-]*$/.test(name)) {
[435] Fix | Delete
console.error('Plugin names must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".');
[436] Fix | Delete
return null;
[437] Fix | Delete
}
[438] Fix | Delete
[439] Fix | Delete
if (api_plugins[name]) {
[440] Fix | Delete
console.error("Plugin \"".concat(name, "\" is already registered."));
[441] Fix | Delete
}
[442] Fix | Delete
[443] Fix | Delete
settings = Object(external_wp_hooks_["applyFilters"])('plugins.registerPlugin', settings, name);
[444] Fix | Delete
[445] Fix | Delete
if (!Object(external_lodash_["isFunction"])(settings.render)) {
[446] Fix | Delete
console.error('The "render" property must be specified and must be a valid function.');
[447] Fix | Delete
return null;
[448] Fix | Delete
}
[449] Fix | Delete
[450] Fix | Delete
api_plugins[name] = _objectSpread({
[451] Fix | Delete
name: name,
[452] Fix | Delete
icon: library_plugins
[453] Fix | Delete
}, settings);
[454] Fix | Delete
Object(external_wp_hooks_["doAction"])('plugins.pluginRegistered', settings, name);
[455] Fix | Delete
return settings;
[456] Fix | Delete
}
[457] Fix | Delete
/**
[458] Fix | Delete
* Unregisters a plugin by name.
[459] Fix | Delete
*
[460] Fix | Delete
* @param {string} name Plugin name.
[461] Fix | Delete
*
[462] Fix | Delete
* @example
[463] Fix | Delete
* <caption>ES5</caption>
[464] Fix | Delete
* ```js
[465] Fix | Delete
* // Using ES5 syntax
[466] Fix | Delete
* var unregisterPlugin = wp.plugins.unregisterPlugin;
[467] Fix | Delete
*
[468] Fix | Delete
* unregisterPlugin( 'plugin-name' );
[469] Fix | Delete
* ```
[470] Fix | Delete
*
[471] Fix | Delete
* @example
[472] Fix | Delete
* <caption>ESNext</caption>
[473] Fix | Delete
* ```js
[474] Fix | Delete
* // Using ESNext syntax
[475] Fix | Delete
* import { unregisterPlugin } from '@wordpress/plugins';
[476] Fix | Delete
*
[477] Fix | Delete
* unregisterPlugin( 'plugin-name' );
[478] Fix | Delete
* ```
[479] Fix | Delete
*
[480] Fix | Delete
* @return {?WPPlugin} The previous plugin settings object, if it has been
[481] Fix | Delete
* successfully unregistered; otherwise `undefined`.
[482] Fix | Delete
*/
[483] Fix | Delete
[484] Fix | Delete
function unregisterPlugin(name) {
[485] Fix | Delete
if (!api_plugins[name]) {
[486] Fix | Delete
console.error('Plugin "' + name + '" is not registered.');
[487] Fix | Delete
return;
[488] Fix | Delete
}
[489] Fix | Delete
[490] Fix | Delete
var oldPlugin = api_plugins[name];
[491] Fix | Delete
delete api_plugins[name];
[492] Fix | Delete
Object(external_wp_hooks_["doAction"])('plugins.pluginUnregistered', oldPlugin, name);
[493] Fix | Delete
return oldPlugin;
[494] Fix | Delete
}
[495] Fix | Delete
/**
[496] Fix | Delete
* Returns a registered plugin settings.
[497] Fix | Delete
*
[498] Fix | Delete
* @param {string} name Plugin name.
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function