Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: edit-widgets.js
width: '100vw'
[1500] Fix | Delete
}
[1501] Fix | Delete
},
[1502] Fix | Delete
transition: defaultTransition,
[1503] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[1504] Fix | Delete
style: {
[1505] Fix | Delete
position: 'absolute',
[1506] Fix | Delete
width: isMobileViewport ? '100vw' : 'fit-content',
[1507] Fix | Delete
height: '100%',
[1508] Fix | Delete
right: 0
[1509] Fix | Delete
},
[1510] Fix | Delete
children: [secondarySidebarResizeListener, secondarySidebar]
[1511] Fix | Delete
})
[1512] Fix | Delete
})
[1513] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableRegion, {
[1514] Fix | Delete
className: "interface-interface-skeleton__content",
[1515] Fix | Delete
ariaLabel: mergedLabels.body,
[1516] Fix | Delete
children: content
[1517] Fix | Delete
}), !!sidebar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableRegion, {
[1518] Fix | Delete
className: "interface-interface-skeleton__sidebar",
[1519] Fix | Delete
ariaLabel: mergedLabels.sidebar,
[1520] Fix | Delete
children: sidebar
[1521] Fix | Delete
}), !!actions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableRegion, {
[1522] Fix | Delete
className: "interface-interface-skeleton__actions",
[1523] Fix | Delete
ariaLabel: mergedLabels.actions,
[1524] Fix | Delete
children: actions
[1525] Fix | Delete
})]
[1526] Fix | Delete
})]
[1527] Fix | Delete
}), !!footer && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableRegion, {
[1528] Fix | Delete
className: "interface-interface-skeleton__footer",
[1529] Fix | Delete
ariaLabel: mergedLabels.footer,
[1530] Fix | Delete
children: footer
[1531] Fix | Delete
})]
[1532] Fix | Delete
});
[1533] Fix | Delete
}
[1534] Fix | Delete
/* harmony default export */ const interface_skeleton = ((0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton));
[1535] Fix | Delete
[1536] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/components/index.js
[1537] Fix | Delete
[1538] Fix | Delete
[1539] Fix | Delete
[1540] Fix | Delete
[1541] Fix | Delete
[1542] Fix | Delete
[1543] Fix | Delete
[1544] Fix | Delete
[1545] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/interface/build-module/index.js
[1546] Fix | Delete
[1547] Fix | Delete
[1548] Fix | Delete
[1549] Fix | Delete
;// CONCATENATED MODULE: external ["wp","blockEditor"]
[1550] Fix | Delete
const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
[1551] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/transformers.js
[1552] Fix | Delete
/**
[1553] Fix | Delete
* WordPress dependencies
[1554] Fix | Delete
*/
[1555] Fix | Delete
[1556] Fix | Delete
[1557] Fix | Delete
[1558] Fix | Delete
/**
[1559] Fix | Delete
* Converts a widget entity record into a block.
[1560] Fix | Delete
*
[1561] Fix | Delete
* @param {Object} widget The widget entity record.
[1562] Fix | Delete
* @return {Object} a block (converted from the entity record).
[1563] Fix | Delete
*/
[1564] Fix | Delete
function transformWidgetToBlock(widget) {
[1565] Fix | Delete
if (widget.id_base === 'block') {
[1566] Fix | Delete
const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(widget.instance.raw.content, {
[1567] Fix | Delete
__unstableSkipAutop: true
[1568] Fix | Delete
});
[1569] Fix | Delete
if (!parsedBlocks.length) {
[1570] Fix | Delete
return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {}, []), widget.id);
[1571] Fix | Delete
}
[1572] Fix | Delete
return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)(parsedBlocks[0], widget.id);
[1573] Fix | Delete
}
[1574] Fix | Delete
let attributes;
[1575] Fix | Delete
if (widget._embedded.about[0].is_multi) {
[1576] Fix | Delete
attributes = {
[1577] Fix | Delete
idBase: widget.id_base,
[1578] Fix | Delete
instance: widget.instance
[1579] Fix | Delete
};
[1580] Fix | Delete
} else {
[1581] Fix | Delete
attributes = {
[1582] Fix | Delete
id: widget.id
[1583] Fix | Delete
};
[1584] Fix | Delete
}
[1585] Fix | Delete
return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)((0,external_wp_blocks_namespaceObject.createBlock)('core/legacy-widget', attributes, []), widget.id);
[1586] Fix | Delete
}
[1587] Fix | Delete
[1588] Fix | Delete
/**
[1589] Fix | Delete
* Converts a block to a widget entity record.
[1590] Fix | Delete
*
[1591] Fix | Delete
* @param {Object} block The block.
[1592] Fix | Delete
* @param {Object?} relatedWidget A related widget entity record from the API (optional).
[1593] Fix | Delete
* @return {Object} the widget object (converted from block).
[1594] Fix | Delete
*/
[1595] Fix | Delete
function transformBlockToWidget(block, relatedWidget = {}) {
[1596] Fix | Delete
let widget;
[1597] Fix | Delete
const isValidLegacyWidgetBlock = block.name === 'core/legacy-widget' && (block.attributes.id || block.attributes.instance);
[1598] Fix | Delete
if (isValidLegacyWidgetBlock) {
[1599] Fix | Delete
var _block$attributes$id, _block$attributes$idB, _block$attributes$ins;
[1600] Fix | Delete
widget = {
[1601] Fix | Delete
...relatedWidget,
[1602] Fix | Delete
id: (_block$attributes$id = block.attributes.id) !== null && _block$attributes$id !== void 0 ? _block$attributes$id : relatedWidget.id,
[1603] Fix | Delete
id_base: (_block$attributes$idB = block.attributes.idBase) !== null && _block$attributes$idB !== void 0 ? _block$attributes$idB : relatedWidget.id_base,
[1604] Fix | Delete
instance: (_block$attributes$ins = block.attributes.instance) !== null && _block$attributes$ins !== void 0 ? _block$attributes$ins : relatedWidget.instance
[1605] Fix | Delete
};
[1606] Fix | Delete
} else {
[1607] Fix | Delete
widget = {
[1608] Fix | Delete
...relatedWidget,
[1609] Fix | Delete
id_base: 'block',
[1610] Fix | Delete
instance: {
[1611] Fix | Delete
raw: {
[1612] Fix | Delete
content: (0,external_wp_blocks_namespaceObject.serialize)(block)
[1613] Fix | Delete
}
[1614] Fix | Delete
}
[1615] Fix | Delete
};
[1616] Fix | Delete
}
[1617] Fix | Delete
[1618] Fix | Delete
// Delete read-only properties.
[1619] Fix | Delete
delete widget.rendered;
[1620] Fix | Delete
delete widget.rendered_form;
[1621] Fix | Delete
return widget;
[1622] Fix | Delete
}
[1623] Fix | Delete
[1624] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/utils.js
[1625] Fix | Delete
/**
[1626] Fix | Delete
* "Kind" of the navigation post.
[1627] Fix | Delete
*
[1628] Fix | Delete
* @type {string}
[1629] Fix | Delete
*/
[1630] Fix | Delete
const KIND = 'root';
[1631] Fix | Delete
[1632] Fix | Delete
/**
[1633] Fix | Delete
* "post type" of the navigation post.
[1634] Fix | Delete
*
[1635] Fix | Delete
* @type {string}
[1636] Fix | Delete
*/
[1637] Fix | Delete
const WIDGET_AREA_ENTITY_TYPE = 'sidebar';
[1638] Fix | Delete
[1639] Fix | Delete
/**
[1640] Fix | Delete
* "post type" of the widget area post.
[1641] Fix | Delete
*
[1642] Fix | Delete
* @type {string}
[1643] Fix | Delete
*/
[1644] Fix | Delete
const POST_TYPE = 'postType';
[1645] Fix | Delete
[1646] Fix | Delete
/**
[1647] Fix | Delete
* Builds an ID for a new widget area post.
[1648] Fix | Delete
*
[1649] Fix | Delete
* @param {number} widgetAreaId Widget area id.
[1650] Fix | Delete
* @return {string} An ID.
[1651] Fix | Delete
*/
[1652] Fix | Delete
const buildWidgetAreaPostId = widgetAreaId => `widget-area-${widgetAreaId}`;
[1653] Fix | Delete
[1654] Fix | Delete
/**
[1655] Fix | Delete
* Builds an ID for a global widget areas post.
[1656] Fix | Delete
*
[1657] Fix | Delete
* @return {string} An ID.
[1658] Fix | Delete
*/
[1659] Fix | Delete
const buildWidgetAreasPostId = () => `widget-areas`;
[1660] Fix | Delete
[1661] Fix | Delete
/**
[1662] Fix | Delete
* Builds a query to resolve sidebars.
[1663] Fix | Delete
*
[1664] Fix | Delete
* @return {Object} Query.
[1665] Fix | Delete
*/
[1666] Fix | Delete
function buildWidgetAreasQuery() {
[1667] Fix | Delete
return {
[1668] Fix | Delete
per_page: -1
[1669] Fix | Delete
};
[1670] Fix | Delete
}
[1671] Fix | Delete
[1672] Fix | Delete
/**
[1673] Fix | Delete
* Builds a query to resolve widgets.
[1674] Fix | Delete
*
[1675] Fix | Delete
* @return {Object} Query.
[1676] Fix | Delete
*/
[1677] Fix | Delete
function buildWidgetsQuery() {
[1678] Fix | Delete
return {
[1679] Fix | Delete
per_page: -1,
[1680] Fix | Delete
_embed: 'about'
[1681] Fix | Delete
};
[1682] Fix | Delete
}
[1683] Fix | Delete
[1684] Fix | Delete
/**
[1685] Fix | Delete
* Creates a stub post with given id and set of blocks. Used as a governing entity records
[1686] Fix | Delete
* for all widget areas.
[1687] Fix | Delete
*
[1688] Fix | Delete
* @param {string} id Post ID.
[1689] Fix | Delete
* @param {Array} blocks The list of blocks.
[1690] Fix | Delete
* @return {Object} A stub post object formatted in compliance with the data layer.
[1691] Fix | Delete
*/
[1692] Fix | Delete
const createStubPost = (id, blocks) => ({
[1693] Fix | Delete
id,
[1694] Fix | Delete
slug: id,
[1695] Fix | Delete
status: 'draft',
[1696] Fix | Delete
type: 'page',
[1697] Fix | Delete
blocks,
[1698] Fix | Delete
meta: {
[1699] Fix | Delete
widgetAreaId: id
[1700] Fix | Delete
}
[1701] Fix | Delete
});
[1702] Fix | Delete
[1703] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/constants.js
[1704] Fix | Delete
/**
[1705] Fix | Delete
* Module Constants
[1706] Fix | Delete
*/
[1707] Fix | Delete
const constants_STORE_NAME = 'core/edit-widgets';
[1708] Fix | Delete
[1709] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js
[1710] Fix | Delete
/**
[1711] Fix | Delete
* WordPress dependencies
[1712] Fix | Delete
*/
[1713] Fix | Delete
[1714] Fix | Delete
[1715] Fix | Delete
[1716] Fix | Delete
[1717] Fix | Delete
[1718] Fix | Delete
[1719] Fix | Delete
[1720] Fix | Delete
/**
[1721] Fix | Delete
* Internal dependencies
[1722] Fix | Delete
*/
[1723] Fix | Delete
[1724] Fix | Delete
[1725] Fix | Delete
[1726] Fix | Delete
[1727] Fix | Delete
/**
[1728] Fix | Delete
* Persists a stub post with given ID to core data store. The post is meant to be in-memory only and
[1729] Fix | Delete
* shouldn't be saved via the API.
[1730] Fix | Delete
*
[1731] Fix | Delete
* @param {string} id Post ID.
[1732] Fix | Delete
* @param {Array} blocks Blocks the post should consist of.
[1733] Fix | Delete
* @return {Object} The post object.
[1734] Fix | Delete
*/
[1735] Fix | Delete
const persistStubPost = (id, blocks) => ({
[1736] Fix | Delete
registry
[1737] Fix | Delete
}) => {
[1738] Fix | Delete
const stubPost = createStubPost(id, blocks);
[1739] Fix | Delete
registry.dispatch(external_wp_coreData_namespaceObject.store).receiveEntityRecords(KIND, POST_TYPE, stubPost, {
[1740] Fix | Delete
id: stubPost.id
[1741] Fix | Delete
}, false);
[1742] Fix | Delete
return stubPost;
[1743] Fix | Delete
};
[1744] Fix | Delete
[1745] Fix | Delete
/**
[1746] Fix | Delete
* Converts all the blocks from edited widget areas into widgets,
[1747] Fix | Delete
* and submits a batch request to save everything at once.
[1748] Fix | Delete
*
[1749] Fix | Delete
* Creates a snackbar notice on either success or error.
[1750] Fix | Delete
*
[1751] Fix | Delete
* @return {Function} An action creator.
[1752] Fix | Delete
*/
[1753] Fix | Delete
const saveEditedWidgetAreas = () => async ({
[1754] Fix | Delete
select,
[1755] Fix | Delete
dispatch,
[1756] Fix | Delete
registry
[1757] Fix | Delete
}) => {
[1758] Fix | Delete
const editedWidgetAreas = select.getEditedWidgetAreas();
[1759] Fix | Delete
if (!editedWidgetAreas?.length) {
[1760] Fix | Delete
return;
[1761] Fix | Delete
}
[1762] Fix | Delete
try {
[1763] Fix | Delete
await dispatch.saveWidgetAreas(editedWidgetAreas);
[1764] Fix | Delete
registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Widgets saved.'), {
[1765] Fix | Delete
type: 'snackbar'
[1766] Fix | Delete
});
[1767] Fix | Delete
} catch (e) {
[1768] Fix | Delete
registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice( /* translators: %s: The error message. */
[1769] Fix | Delete
(0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('There was an error. %s'), e.message), {
[1770] Fix | Delete
type: 'snackbar'
[1771] Fix | Delete
});
[1772] Fix | Delete
}
[1773] Fix | Delete
};
[1774] Fix | Delete
[1775] Fix | Delete
/**
[1776] Fix | Delete
* Converts all the blocks from specified widget areas into widgets,
[1777] Fix | Delete
* and submits a batch request to save everything at once.
[1778] Fix | Delete
*
[1779] Fix | Delete
* @param {Object[]} widgetAreas Widget areas to save.
[1780] Fix | Delete
* @return {Function} An action creator.
[1781] Fix | Delete
*/
[1782] Fix | Delete
const saveWidgetAreas = widgetAreas => async ({
[1783] Fix | Delete
dispatch,
[1784] Fix | Delete
registry
[1785] Fix | Delete
}) => {
[1786] Fix | Delete
try {
[1787] Fix | Delete
for (const widgetArea of widgetAreas) {
[1788] Fix | Delete
await dispatch.saveWidgetArea(widgetArea.id);
[1789] Fix | Delete
}
[1790] Fix | Delete
} finally {
[1791] Fix | Delete
// saveEditedEntityRecord resets the resolution status, let's fix it manually.
[1792] Fix | Delete
await registry.dispatch(external_wp_coreData_namespaceObject.store).finishResolution('getEntityRecord', KIND, WIDGET_AREA_ENTITY_TYPE, buildWidgetAreasQuery());
[1793] Fix | Delete
}
[1794] Fix | Delete
};
[1795] Fix | Delete
[1796] Fix | Delete
/**
[1797] Fix | Delete
* Converts all the blocks from a widget area specified by ID into widgets,
[1798] Fix | Delete
* and submits a batch request to save everything at once.
[1799] Fix | Delete
*
[1800] Fix | Delete
* @param {string} widgetAreaId ID of the widget area to process.
[1801] Fix | Delete
* @return {Function} An action creator.
[1802] Fix | Delete
*/
[1803] Fix | Delete
const saveWidgetArea = widgetAreaId => async ({
[1804] Fix | Delete
dispatch,
[1805] Fix | Delete
select,
[1806] Fix | Delete
registry
[1807] Fix | Delete
}) => {
[1808] Fix | Delete
const widgets = select.getWidgets();
[1809] Fix | Delete
const post = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(widgetAreaId));
[1810] Fix | Delete
[1811] Fix | Delete
// Get all widgets from this area
[1812] Fix | Delete
const areaWidgets = Object.values(widgets).filter(({
[1813] Fix | Delete
sidebar
[1814] Fix | Delete
}) => sidebar === widgetAreaId);
[1815] Fix | Delete
[1816] Fix | Delete
// Remove all duplicate reference widget instances for legacy widgets.
[1817] Fix | Delete
// Why? We filter out the widgets with duplicate IDs to prevent adding more than one instance of a widget
[1818] Fix | Delete
// implemented using a function. WordPress doesn't support having more than one instance of these, if you try to
[1819] Fix | Delete
// save multiple instances of these in different sidebars you will run into undefined behaviors.
[1820] Fix | Delete
const usedReferenceWidgets = [];
[1821] Fix | Delete
const widgetsBlocks = post.blocks.filter(block => {
[1822] Fix | Delete
const {
[1823] Fix | Delete
id
[1824] Fix | Delete
} = block.attributes;
[1825] Fix | Delete
if (block.name === 'core/legacy-widget' && id) {
[1826] Fix | Delete
if (usedReferenceWidgets.includes(id)) {
[1827] Fix | Delete
return false;
[1828] Fix | Delete
}
[1829] Fix | Delete
usedReferenceWidgets.push(id);
[1830] Fix | Delete
}
[1831] Fix | Delete
return true;
[1832] Fix | Delete
});
[1833] Fix | Delete
[1834] Fix | Delete
// Determine which widgets have been deleted. We can tell if a widget is
[1835] Fix | Delete
// deleted and not just moved to a different area by looking to see if
[1836] Fix | Delete
// getWidgetAreaForWidgetId() finds something.
[1837] Fix | Delete
const deletedWidgets = [];
[1838] Fix | Delete
for (const widget of areaWidgets) {
[1839] Fix | Delete
const widgetsNewArea = select.getWidgetAreaForWidgetId(widget.id);
[1840] Fix | Delete
if (!widgetsNewArea) {
[1841] Fix | Delete
deletedWidgets.push(widget);
[1842] Fix | Delete
}
[1843] Fix | Delete
}
[1844] Fix | Delete
const batchMeta = [];
[1845] Fix | Delete
const batchTasks = [];
[1846] Fix | Delete
const sidebarWidgetsIds = [];
[1847] Fix | Delete
for (let i = 0; i < widgetsBlocks.length; i++) {
[1848] Fix | Delete
const block = widgetsBlocks[i];
[1849] Fix | Delete
const widgetId = (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block);
[1850] Fix | Delete
const oldWidget = widgets[widgetId];
[1851] Fix | Delete
const widget = transformBlockToWidget(block, oldWidget);
[1852] Fix | Delete
[1853] Fix | Delete
// We'll replace the null widgetId after save, but we track it here
[1854] Fix | Delete
// since order is important.
[1855] Fix | Delete
sidebarWidgetsIds.push(widgetId);
[1856] Fix | Delete
[1857] Fix | Delete
// Check oldWidget as widgetId might refer to an ID which has been
[1858] Fix | Delete
// deleted, e.g. if a deleted block is restored via undo after saving.
[1859] Fix | Delete
if (oldWidget) {
[1860] Fix | Delete
// Update an existing widget.
[1861] Fix | Delete
registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('root', 'widget', widgetId, {
[1862] Fix | Delete
...widget,
[1863] Fix | Delete
sidebar: widgetAreaId
[1864] Fix | Delete
}, {
[1865] Fix | Delete
undoIgnore: true
[1866] Fix | Delete
});
[1867] Fix | Delete
const hasEdits = registry.select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord('root', 'widget', widgetId);
[1868] Fix | Delete
if (!hasEdits) {
[1869] Fix | Delete
continue;
[1870] Fix | Delete
}
[1871] Fix | Delete
batchTasks.push(({
[1872] Fix | Delete
saveEditedEntityRecord
[1873] Fix | Delete
}) => saveEditedEntityRecord('root', 'widget', widgetId));
[1874] Fix | Delete
} else {
[1875] Fix | Delete
// Create a new widget.
[1876] Fix | Delete
batchTasks.push(({
[1877] Fix | Delete
saveEntityRecord
[1878] Fix | Delete
}) => saveEntityRecord('root', 'widget', {
[1879] Fix | Delete
...widget,
[1880] Fix | Delete
sidebar: widgetAreaId
[1881] Fix | Delete
}));
[1882] Fix | Delete
}
[1883] Fix | Delete
batchMeta.push({
[1884] Fix | Delete
block,
[1885] Fix | Delete
position: i,
[1886] Fix | Delete
clientId: block.clientId
[1887] Fix | Delete
});
[1888] Fix | Delete
}
[1889] Fix | Delete
for (const widget of deletedWidgets) {
[1890] Fix | Delete
batchTasks.push(({
[1891] Fix | Delete
deleteEntityRecord
[1892] Fix | Delete
}) => deleteEntityRecord('root', 'widget', widget.id, {
[1893] Fix | Delete
force: true
[1894] Fix | Delete
}));
[1895] Fix | Delete
}
[1896] Fix | Delete
const records = await registry.dispatch(external_wp_coreData_namespaceObject.store).__experimentalBatch(batchTasks);
[1897] Fix | Delete
const preservedRecords = records.filter(record => !record.hasOwnProperty('deleted'));
[1898] Fix | Delete
const failedWidgetNames = [];
[1899] Fix | Delete
for (let i = 0; i < preservedRecords.length; i++) {
[1900] Fix | Delete
const widget = preservedRecords[i];
[1901] Fix | Delete
const {
[1902] Fix | Delete
block,
[1903] Fix | Delete
position
[1904] Fix | Delete
} = batchMeta[i];
[1905] Fix | Delete
[1906] Fix | Delete
// Set __internalWidgetId on the block. This will be persisted to the
[1907] Fix | Delete
// store when we dispatch receiveEntityRecords( post ) below.
[1908] Fix | Delete
post.blocks[position].attributes.__internalWidgetId = widget.id;
[1909] Fix | Delete
const error = registry.select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError('root', 'widget', widget.id);
[1910] Fix | Delete
if (error) {
[1911] Fix | Delete
failedWidgetNames.push(block.attributes?.name || block?.name);
[1912] Fix | Delete
}
[1913] Fix | Delete
if (!sidebarWidgetsIds[position]) {
[1914] Fix | Delete
sidebarWidgetsIds[position] = widget.id;
[1915] Fix | Delete
}
[1916] Fix | Delete
}
[1917] Fix | Delete
if (failedWidgetNames.length) {
[1918] Fix | Delete
throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: List of widget names */
[1919] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('Could not save the following widgets: %s.'), failedWidgetNames.join(', ')));
[1920] Fix | Delete
}
[1921] Fix | Delete
registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId, {
[1922] Fix | Delete
widgets: sidebarWidgetsIds
[1923] Fix | Delete
}, {
[1924] Fix | Delete
undoIgnore: true
[1925] Fix | Delete
});
[1926] Fix | Delete
dispatch(trySaveWidgetArea(widgetAreaId));
[1927] Fix | Delete
registry.dispatch(external_wp_coreData_namespaceObject.store).receiveEntityRecords(KIND, POST_TYPE, post, undefined);
[1928] Fix | Delete
};
[1929] Fix | Delete
const trySaveWidgetArea = widgetAreaId => ({
[1930] Fix | Delete
registry
[1931] Fix | Delete
}) => {
[1932] Fix | Delete
registry.dispatch(external_wp_coreData_namespaceObject.store).saveEditedEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId, {
[1933] Fix | Delete
throwOnError: true
[1934] Fix | Delete
});
[1935] Fix | Delete
};
[1936] Fix | Delete
[1937] Fix | Delete
/**
[1938] Fix | Delete
* Sets the clientId stored for a particular widgetId.
[1939] Fix | Delete
*
[1940] Fix | Delete
* @param {number} clientId Client id.
[1941] Fix | Delete
* @param {number} widgetId Widget id.
[1942] Fix | Delete
*
[1943] Fix | Delete
* @return {Object} Action.
[1944] Fix | Delete
*/
[1945] Fix | Delete
function setWidgetIdForClientId(clientId, widgetId) {
[1946] Fix | Delete
return {
[1947] Fix | Delete
type: 'SET_WIDGET_ID_FOR_CLIENT_ID',
[1948] Fix | Delete
clientId,
[1949] Fix | Delete
widgetId
[1950] Fix | Delete
};
[1951] Fix | Delete
}
[1952] Fix | Delete
[1953] Fix | Delete
/**
[1954] Fix | Delete
* Sets the open state of all the widget areas.
[1955] Fix | Delete
*
[1956] Fix | Delete
* @param {Object} widgetAreasOpenState The open states of all the widget areas.
[1957] Fix | Delete
*
[1958] Fix | Delete
* @return {Object} Action.
[1959] Fix | Delete
*/
[1960] Fix | Delete
function setWidgetAreasOpenState(widgetAreasOpenState) {
[1961] Fix | Delete
return {
[1962] Fix | Delete
type: 'SET_WIDGET_AREAS_OPEN_STATE',
[1963] Fix | Delete
widgetAreasOpenState
[1964] Fix | Delete
};
[1965] Fix | Delete
}
[1966] Fix | Delete
[1967] Fix | Delete
/**
[1968] Fix | Delete
* Sets the open state of the widget area.
[1969] Fix | Delete
*
[1970] Fix | Delete
* @param {string} clientId The clientId of the widget area.
[1971] Fix | Delete
* @param {boolean} isOpen Whether the widget area should be opened.
[1972] Fix | Delete
*
[1973] Fix | Delete
* @return {Object} Action.
[1974] Fix | Delete
*/
[1975] Fix | Delete
function setIsWidgetAreaOpen(clientId, isOpen) {
[1976] Fix | Delete
return {
[1977] Fix | Delete
type: 'SET_IS_WIDGET_AREA_OPEN',
[1978] Fix | Delete
clientId,
[1979] Fix | Delete
isOpen
[1980] Fix | Delete
};
[1981] Fix | Delete
}
[1982] Fix | Delete
[1983] Fix | Delete
/**
[1984] Fix | Delete
* Returns an action object used to open/close the inserter.
[1985] Fix | Delete
*
[1986] Fix | Delete
* @param {boolean|Object} value Whether the inserter should be
[1987] Fix | Delete
* opened (true) or closed (false).
[1988] Fix | Delete
* To specify an insertion point,
[1989] Fix | Delete
* use an object.
[1990] Fix | Delete
* @param {string} value.rootClientId The root client ID to insert at.
[1991] Fix | Delete
* @param {number} value.insertionIndex The index to insert at.
[1992] Fix | Delete
*
[1993] Fix | Delete
* @return {Object} Action object.
[1994] Fix | Delete
*/
[1995] Fix | Delete
function setIsInserterOpened(value) {
[1996] Fix | Delete
return {
[1997] Fix | Delete
type: 'SET_IS_INSERTER_OPENED',
[1998] Fix | Delete
value
[1999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function