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: blocks.js
background: {
[6500] Fix | Delete
value: ['color', 'gradient'],
[6501] Fix | Delete
support: ['color', 'gradients'],
[6502] Fix | Delete
useEngine: true
[6503] Fix | Delete
},
[6504] Fix | Delete
backgroundColor: {
[6505] Fix | Delete
value: ['color', 'background'],
[6506] Fix | Delete
support: ['color', 'background'],
[6507] Fix | Delete
requiresOptOut: true,
[6508] Fix | Delete
useEngine: true
[6509] Fix | Delete
},
[6510] Fix | Delete
backgroundImage: {
[6511] Fix | Delete
value: ['background', 'backgroundImage'],
[6512] Fix | Delete
support: ['background', 'backgroundImage'],
[6513] Fix | Delete
useEngine: true
[6514] Fix | Delete
},
[6515] Fix | Delete
backgroundRepeat: {
[6516] Fix | Delete
value: ['background', 'backgroundRepeat'],
[6517] Fix | Delete
support: ['background', 'backgroundRepeat'],
[6518] Fix | Delete
useEngine: true
[6519] Fix | Delete
},
[6520] Fix | Delete
backgroundSize: {
[6521] Fix | Delete
value: ['background', 'backgroundSize'],
[6522] Fix | Delete
support: ['background', 'backgroundSize'],
[6523] Fix | Delete
useEngine: true
[6524] Fix | Delete
},
[6525] Fix | Delete
backgroundPosition: {
[6526] Fix | Delete
value: ['background', 'backgroundPosition'],
[6527] Fix | Delete
support: ['background', 'backgroundPosition'],
[6528] Fix | Delete
useEngine: true
[6529] Fix | Delete
},
[6530] Fix | Delete
borderColor: {
[6531] Fix | Delete
value: ['border', 'color'],
[6532] Fix | Delete
support: ['__experimentalBorder', 'color'],
[6533] Fix | Delete
useEngine: true
[6534] Fix | Delete
},
[6535] Fix | Delete
borderRadius: {
[6536] Fix | Delete
value: ['border', 'radius'],
[6537] Fix | Delete
support: ['__experimentalBorder', 'radius'],
[6538] Fix | Delete
properties: {
[6539] Fix | Delete
borderTopLeftRadius: 'topLeft',
[6540] Fix | Delete
borderTopRightRadius: 'topRight',
[6541] Fix | Delete
borderBottomLeftRadius: 'bottomLeft',
[6542] Fix | Delete
borderBottomRightRadius: 'bottomRight'
[6543] Fix | Delete
},
[6544] Fix | Delete
useEngine: true
[6545] Fix | Delete
},
[6546] Fix | Delete
borderStyle: {
[6547] Fix | Delete
value: ['border', 'style'],
[6548] Fix | Delete
support: ['__experimentalBorder', 'style'],
[6549] Fix | Delete
useEngine: true
[6550] Fix | Delete
},
[6551] Fix | Delete
borderWidth: {
[6552] Fix | Delete
value: ['border', 'width'],
[6553] Fix | Delete
support: ['__experimentalBorder', 'width'],
[6554] Fix | Delete
useEngine: true
[6555] Fix | Delete
},
[6556] Fix | Delete
borderTopColor: {
[6557] Fix | Delete
value: ['border', 'top', 'color'],
[6558] Fix | Delete
support: ['__experimentalBorder', 'color'],
[6559] Fix | Delete
useEngine: true
[6560] Fix | Delete
},
[6561] Fix | Delete
borderTopStyle: {
[6562] Fix | Delete
value: ['border', 'top', 'style'],
[6563] Fix | Delete
support: ['__experimentalBorder', 'style'],
[6564] Fix | Delete
useEngine: true
[6565] Fix | Delete
},
[6566] Fix | Delete
borderTopWidth: {
[6567] Fix | Delete
value: ['border', 'top', 'width'],
[6568] Fix | Delete
support: ['__experimentalBorder', 'width'],
[6569] Fix | Delete
useEngine: true
[6570] Fix | Delete
},
[6571] Fix | Delete
borderRightColor: {
[6572] Fix | Delete
value: ['border', 'right', 'color'],
[6573] Fix | Delete
support: ['__experimentalBorder', 'color'],
[6574] Fix | Delete
useEngine: true
[6575] Fix | Delete
},
[6576] Fix | Delete
borderRightStyle: {
[6577] Fix | Delete
value: ['border', 'right', 'style'],
[6578] Fix | Delete
support: ['__experimentalBorder', 'style'],
[6579] Fix | Delete
useEngine: true
[6580] Fix | Delete
},
[6581] Fix | Delete
borderRightWidth: {
[6582] Fix | Delete
value: ['border', 'right', 'width'],
[6583] Fix | Delete
support: ['__experimentalBorder', 'width'],
[6584] Fix | Delete
useEngine: true
[6585] Fix | Delete
},
[6586] Fix | Delete
borderBottomColor: {
[6587] Fix | Delete
value: ['border', 'bottom', 'color'],
[6588] Fix | Delete
support: ['__experimentalBorder', 'color'],
[6589] Fix | Delete
useEngine: true
[6590] Fix | Delete
},
[6591] Fix | Delete
borderBottomStyle: {
[6592] Fix | Delete
value: ['border', 'bottom', 'style'],
[6593] Fix | Delete
support: ['__experimentalBorder', 'style'],
[6594] Fix | Delete
useEngine: true
[6595] Fix | Delete
},
[6596] Fix | Delete
borderBottomWidth: {
[6597] Fix | Delete
value: ['border', 'bottom', 'width'],
[6598] Fix | Delete
support: ['__experimentalBorder', 'width'],
[6599] Fix | Delete
useEngine: true
[6600] Fix | Delete
},
[6601] Fix | Delete
borderLeftColor: {
[6602] Fix | Delete
value: ['border', 'left', 'color'],
[6603] Fix | Delete
support: ['__experimentalBorder', 'color'],
[6604] Fix | Delete
useEngine: true
[6605] Fix | Delete
},
[6606] Fix | Delete
borderLeftStyle: {
[6607] Fix | Delete
value: ['border', 'left', 'style'],
[6608] Fix | Delete
support: ['__experimentalBorder', 'style'],
[6609] Fix | Delete
useEngine: true
[6610] Fix | Delete
},
[6611] Fix | Delete
borderLeftWidth: {
[6612] Fix | Delete
value: ['border', 'left', 'width'],
[6613] Fix | Delete
support: ['__experimentalBorder', 'width'],
[6614] Fix | Delete
useEngine: true
[6615] Fix | Delete
},
[6616] Fix | Delete
color: {
[6617] Fix | Delete
value: ['color', 'text'],
[6618] Fix | Delete
support: ['color', 'text'],
[6619] Fix | Delete
requiresOptOut: true,
[6620] Fix | Delete
useEngine: true
[6621] Fix | Delete
},
[6622] Fix | Delete
columnCount: {
[6623] Fix | Delete
value: ['typography', 'textColumns'],
[6624] Fix | Delete
support: ['typography', 'textColumns'],
[6625] Fix | Delete
useEngine: true
[6626] Fix | Delete
},
[6627] Fix | Delete
filter: {
[6628] Fix | Delete
value: ['filter', 'duotone'],
[6629] Fix | Delete
support: ['filter', 'duotone']
[6630] Fix | Delete
},
[6631] Fix | Delete
linkColor: {
[6632] Fix | Delete
value: ['elements', 'link', 'color', 'text'],
[6633] Fix | Delete
support: ['color', 'link']
[6634] Fix | Delete
},
[6635] Fix | Delete
captionColor: {
[6636] Fix | Delete
value: ['elements', 'caption', 'color', 'text'],
[6637] Fix | Delete
support: ['color', 'caption']
[6638] Fix | Delete
},
[6639] Fix | Delete
buttonColor: {
[6640] Fix | Delete
value: ['elements', 'button', 'color', 'text'],
[6641] Fix | Delete
support: ['color', 'button']
[6642] Fix | Delete
},
[6643] Fix | Delete
buttonBackgroundColor: {
[6644] Fix | Delete
value: ['elements', 'button', 'color', 'background'],
[6645] Fix | Delete
support: ['color', 'button']
[6646] Fix | Delete
},
[6647] Fix | Delete
headingColor: {
[6648] Fix | Delete
value: ['elements', 'heading', 'color', 'text'],
[6649] Fix | Delete
support: ['color', 'heading']
[6650] Fix | Delete
},
[6651] Fix | Delete
headingBackgroundColor: {
[6652] Fix | Delete
value: ['elements', 'heading', 'color', 'background'],
[6653] Fix | Delete
support: ['color', 'heading']
[6654] Fix | Delete
},
[6655] Fix | Delete
fontFamily: {
[6656] Fix | Delete
value: ['typography', 'fontFamily'],
[6657] Fix | Delete
support: ['typography', '__experimentalFontFamily'],
[6658] Fix | Delete
useEngine: true
[6659] Fix | Delete
},
[6660] Fix | Delete
fontSize: {
[6661] Fix | Delete
value: ['typography', 'fontSize'],
[6662] Fix | Delete
support: ['typography', 'fontSize'],
[6663] Fix | Delete
useEngine: true
[6664] Fix | Delete
},
[6665] Fix | Delete
fontStyle: {
[6666] Fix | Delete
value: ['typography', 'fontStyle'],
[6667] Fix | Delete
support: ['typography', '__experimentalFontStyle'],
[6668] Fix | Delete
useEngine: true
[6669] Fix | Delete
},
[6670] Fix | Delete
fontWeight: {
[6671] Fix | Delete
value: ['typography', 'fontWeight'],
[6672] Fix | Delete
support: ['typography', '__experimentalFontWeight'],
[6673] Fix | Delete
useEngine: true
[6674] Fix | Delete
},
[6675] Fix | Delete
lineHeight: {
[6676] Fix | Delete
value: ['typography', 'lineHeight'],
[6677] Fix | Delete
support: ['typography', 'lineHeight'],
[6678] Fix | Delete
useEngine: true
[6679] Fix | Delete
},
[6680] Fix | Delete
margin: {
[6681] Fix | Delete
value: ['spacing', 'margin'],
[6682] Fix | Delete
support: ['spacing', 'margin'],
[6683] Fix | Delete
properties: {
[6684] Fix | Delete
marginTop: 'top',
[6685] Fix | Delete
marginRight: 'right',
[6686] Fix | Delete
marginBottom: 'bottom',
[6687] Fix | Delete
marginLeft: 'left'
[6688] Fix | Delete
},
[6689] Fix | Delete
useEngine: true
[6690] Fix | Delete
},
[6691] Fix | Delete
minHeight: {
[6692] Fix | Delete
value: ['dimensions', 'minHeight'],
[6693] Fix | Delete
support: ['dimensions', 'minHeight'],
[6694] Fix | Delete
useEngine: true
[6695] Fix | Delete
},
[6696] Fix | Delete
padding: {
[6697] Fix | Delete
value: ['spacing', 'padding'],
[6698] Fix | Delete
support: ['spacing', 'padding'],
[6699] Fix | Delete
properties: {
[6700] Fix | Delete
paddingTop: 'top',
[6701] Fix | Delete
paddingRight: 'right',
[6702] Fix | Delete
paddingBottom: 'bottom',
[6703] Fix | Delete
paddingLeft: 'left'
[6704] Fix | Delete
},
[6705] Fix | Delete
useEngine: true
[6706] Fix | Delete
},
[6707] Fix | Delete
textAlign: {
[6708] Fix | Delete
value: ['typography', 'textAlign'],
[6709] Fix | Delete
support: ['typography', 'textAlign'],
[6710] Fix | Delete
useEngine: false
[6711] Fix | Delete
},
[6712] Fix | Delete
textDecoration: {
[6713] Fix | Delete
value: ['typography', 'textDecoration'],
[6714] Fix | Delete
support: ['typography', '__experimentalTextDecoration'],
[6715] Fix | Delete
useEngine: true
[6716] Fix | Delete
},
[6717] Fix | Delete
textTransform: {
[6718] Fix | Delete
value: ['typography', 'textTransform'],
[6719] Fix | Delete
support: ['typography', '__experimentalTextTransform'],
[6720] Fix | Delete
useEngine: true
[6721] Fix | Delete
},
[6722] Fix | Delete
letterSpacing: {
[6723] Fix | Delete
value: ['typography', 'letterSpacing'],
[6724] Fix | Delete
support: ['typography', '__experimentalLetterSpacing'],
[6725] Fix | Delete
useEngine: true
[6726] Fix | Delete
},
[6727] Fix | Delete
writingMode: {
[6728] Fix | Delete
value: ['typography', 'writingMode'],
[6729] Fix | Delete
support: ['typography', '__experimentalWritingMode'],
[6730] Fix | Delete
useEngine: true
[6731] Fix | Delete
},
[6732] Fix | Delete
'--wp--style--root--padding': {
[6733] Fix | Delete
value: ['spacing', 'padding'],
[6734] Fix | Delete
support: ['spacing', 'padding'],
[6735] Fix | Delete
properties: {
[6736] Fix | Delete
'--wp--style--root--padding-top': 'top',
[6737] Fix | Delete
'--wp--style--root--padding-right': 'right',
[6738] Fix | Delete
'--wp--style--root--padding-bottom': 'bottom',
[6739] Fix | Delete
'--wp--style--root--padding-left': 'left'
[6740] Fix | Delete
},
[6741] Fix | Delete
rootOnly: true
[6742] Fix | Delete
}
[6743] Fix | Delete
};
[6744] Fix | Delete
const __EXPERIMENTAL_ELEMENTS = {
[6745] Fix | Delete
link: 'a:where(:not(.wp-element-button))',
[6746] Fix | Delete
heading: 'h1, h2, h3, h4, h5, h6',
[6747] Fix | Delete
h1: 'h1',
[6748] Fix | Delete
h2: 'h2',
[6749] Fix | Delete
h3: 'h3',
[6750] Fix | Delete
h4: 'h4',
[6751] Fix | Delete
h5: 'h5',
[6752] Fix | Delete
h6: 'h6',
[6753] Fix | Delete
button: '.wp-element-button, .wp-block-button__link',
[6754] Fix | Delete
caption: '.wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption',
[6755] Fix | Delete
cite: 'cite'
[6756] Fix | Delete
};
[6757] Fix | Delete
[6758] Fix | Delete
// These paths may have three origins, custom, theme, and default,
[6759] Fix | Delete
// and are expected to override other origins with custom, theme,
[6760] Fix | Delete
// and default priority.
[6761] Fix | Delete
const __EXPERIMENTAL_PATHS_WITH_OVERRIDE = {
[6762] Fix | Delete
'color.duotone': true,
[6763] Fix | Delete
'color.gradients': true,
[6764] Fix | Delete
'color.palette': true,
[6765] Fix | Delete
'dimensions.aspectRatios': true,
[6766] Fix | Delete
'typography.fontSizes': true,
[6767] Fix | Delete
'spacing.spacingSizes': true
[6768] Fix | Delete
};
[6769] Fix | Delete
[6770] Fix | Delete
;// CONCATENATED MODULE: external ["wp","privateApis"]
[6771] Fix | Delete
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
[6772] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/lock-unlock.js
[6773] Fix | Delete
/**
[6774] Fix | Delete
* WordPress dependencies
[6775] Fix | Delete
*/
[6776] Fix | Delete
[6777] Fix | Delete
const {
[6778] Fix | Delete
lock,
[6779] Fix | Delete
unlock
[6780] Fix | Delete
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/blocks');
[6781] Fix | Delete
[6782] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/registration.js
[6783] Fix | Delete
/* eslint no-console: [ 'error', { allow: [ 'error', 'warn' ] } ] */
[6784] Fix | Delete
[6785] Fix | Delete
/**
[6786] Fix | Delete
* WordPress dependencies
[6787] Fix | Delete
*/
[6788] Fix | Delete
[6789] Fix | Delete
[6790] Fix | Delete
[6791] Fix | Delete
/**
[6792] Fix | Delete
* Internal dependencies
[6793] Fix | Delete
*/
[6794] Fix | Delete
const i18nBlockSchema = {
[6795] Fix | Delete
title: "block title",
[6796] Fix | Delete
description: "block description",
[6797] Fix | Delete
keywords: ["block keyword"],
[6798] Fix | Delete
styles: [{
[6799] Fix | Delete
label: "block style label"
[6800] Fix | Delete
}],
[6801] Fix | Delete
variations: [{
[6802] Fix | Delete
title: "block variation title",
[6803] Fix | Delete
description: "block variation description",
[6804] Fix | Delete
keywords: ["block variation keyword"]
[6805] Fix | Delete
}]
[6806] Fix | Delete
};
[6807] Fix | Delete
[6808] Fix | Delete
[6809] Fix | Delete
[6810] Fix | Delete
/**
[6811] Fix | Delete
* An icon type definition. One of a Dashicon slug, an element,
[6812] Fix | Delete
* or a component.
[6813] Fix | Delete
*
[6814] Fix | Delete
* @typedef {(string|Element|Component)} WPIcon
[6815] Fix | Delete
*
[6816] Fix | Delete
* @see https://developer.wordpress.org/resource/dashicons/
[6817] Fix | Delete
*/
[6818] Fix | Delete
[6819] Fix | Delete
/**
[6820] Fix | Delete
* Render behavior of a block type icon; one of a Dashicon slug, an element,
[6821] Fix | Delete
* or a component.
[6822] Fix | Delete
*
[6823] Fix | Delete
* @typedef {WPIcon} WPBlockTypeIconRender
[6824] Fix | Delete
*/
[6825] Fix | Delete
[6826] Fix | Delete
/**
[6827] Fix | Delete
* An object describing a normalized block type icon.
[6828] Fix | Delete
*
[6829] Fix | Delete
* @typedef {Object} WPBlockTypeIconDescriptor
[6830] Fix | Delete
*
[6831] Fix | Delete
* @property {WPBlockTypeIconRender} src Render behavior of the icon,
[6832] Fix | Delete
* one of a Dashicon slug, an
[6833] Fix | Delete
* element, or a component.
[6834] Fix | Delete
* @property {string} background Optimal background hex string
[6835] Fix | Delete
* color when displaying icon.
[6836] Fix | Delete
* @property {string} foreground Optimal foreground hex string
[6837] Fix | Delete
* color when displaying icon.
[6838] Fix | Delete
* @property {string} shadowColor Optimal shadow hex string
[6839] Fix | Delete
* color when displaying icon.
[6840] Fix | Delete
*/
[6841] Fix | Delete
[6842] Fix | Delete
/**
[6843] Fix | Delete
* Value to use to render the icon for a block type in an editor interface,
[6844] Fix | Delete
* either a Dashicon slug, an element, a component, or an object describing
[6845] Fix | Delete
* the icon.
[6846] Fix | Delete
*
[6847] Fix | Delete
* @typedef {(WPBlockTypeIconDescriptor|WPBlockTypeIconRender)} WPBlockTypeIcon
[6848] Fix | Delete
*/
[6849] Fix | Delete
[6850] Fix | Delete
/**
[6851] Fix | Delete
* Named block variation scopes.
[6852] Fix | Delete
*
[6853] Fix | Delete
* @typedef {'block'|'inserter'|'transform'} WPBlockVariationScope
[6854] Fix | Delete
*/
[6855] Fix | Delete
[6856] Fix | Delete
/**
[6857] Fix | Delete
* An object describing a variation defined for the block type.
[6858] Fix | Delete
*
[6859] Fix | Delete
* @typedef {Object} WPBlockVariation
[6860] Fix | Delete
*
[6861] Fix | Delete
* @property {string} name The unique and machine-readable name.
[6862] Fix | Delete
* @property {string} title A human-readable variation title.
[6863] Fix | Delete
* @property {string} [description] A detailed variation description.
[6864] Fix | Delete
* @property {string} [category] Block type category classification,
[6865] Fix | Delete
* used in search interfaces to arrange
[6866] Fix | Delete
* block types by category.
[6867] Fix | Delete
* @property {WPIcon} [icon] An icon helping to visualize the variation.
[6868] Fix | Delete
* @property {boolean} [isDefault] Indicates whether the current variation is
[6869] Fix | Delete
* the default one. Defaults to `false`.
[6870] Fix | Delete
* @property {Object} [attributes] Values which override block attributes.
[6871] Fix | Delete
* @property {Array[]} [innerBlocks] Initial configuration of nested blocks.
[6872] Fix | Delete
* @property {Object} [example] Example provides structured data for
[6873] Fix | Delete
* the block preview. You can set to
[6874] Fix | Delete
* `undefined` to disable the preview shown
[6875] Fix | Delete
* for the block type.
[6876] Fix | Delete
* @property {WPBlockVariationScope[]} [scope] The list of scopes where the variation
[6877] Fix | Delete
* is applicable. When not provided, it
[6878] Fix | Delete
* assumes all available scopes.
[6879] Fix | Delete
* @property {string[]} [keywords] An array of terms (which can be translated)
[6880] Fix | Delete
* that help users discover the variation
[6881] Fix | Delete
* while searching.
[6882] Fix | Delete
* @property {Function|string[]} [isActive] This can be a function or an array of block attributes.
[6883] Fix | Delete
* Function that accepts a block's attributes and the
[6884] Fix | Delete
* variation's attributes and determines if a variation is active.
[6885] Fix | Delete
* This function doesn't try to find a match dynamically based
[6886] Fix | Delete
* on all block's attributes, as in many cases some attributes are irrelevant.
[6887] Fix | Delete
* An example would be for `embed` block where we only care
[6888] Fix | Delete
* about `providerNameSlug` attribute's value.
[6889] Fix | Delete
* We can also use a `string[]` to tell which attributes
[6890] Fix | Delete
* should be compared as a shorthand. Each attributes will
[6891] Fix | Delete
* be matched and the variation will be active if all of them are matching.
[6892] Fix | Delete
*/
[6893] Fix | Delete
[6894] Fix | Delete
/**
[6895] Fix | Delete
* Defined behavior of a block type.
[6896] Fix | Delete
*
[6897] Fix | Delete
* @typedef {Object} WPBlockType
[6898] Fix | Delete
*
[6899] Fix | Delete
* @property {string} name Block type's namespaced name.
[6900] Fix | Delete
* @property {string} title Human-readable block type label.
[6901] Fix | Delete
* @property {string} [description] A detailed block type description.
[6902] Fix | Delete
* @property {string} [category] Block type category classification,
[6903] Fix | Delete
* used in search interfaces to arrange
[6904] Fix | Delete
* block types by category.
[6905] Fix | Delete
* @property {WPBlockTypeIcon} [icon] Block type icon.
[6906] Fix | Delete
* @property {string[]} [keywords] Additional keywords to produce block
[6907] Fix | Delete
* type as result in search interfaces.
[6908] Fix | Delete
* @property {Object} [attributes] Block type attributes.
[6909] Fix | Delete
* @property {Component} [save] Optional component describing
[6910] Fix | Delete
* serialized markup structure of a
[6911] Fix | Delete
* block type.
[6912] Fix | Delete
* @property {Component} edit Component rendering an element to
[6913] Fix | Delete
* manipulate the attributes of a block
[6914] Fix | Delete
* in the context of an editor.
[6915] Fix | Delete
* @property {WPBlockVariation[]} [variations] The list of block variations.
[6916] Fix | Delete
* @property {Object} [example] Example provides structured data for
[6917] Fix | Delete
* the block preview. When not defined
[6918] Fix | Delete
* then no preview is shown.
[6919] Fix | Delete
*/
[6920] Fix | Delete
[6921] Fix | Delete
function isObject(object) {
[6922] Fix | Delete
return object !== null && typeof object === 'object';
[6923] Fix | Delete
}
[6924] Fix | Delete
[6925] Fix | Delete
/**
[6926] Fix | Delete
* Sets the server side block definition of blocks.
[6927] Fix | Delete
*
[6928] Fix | Delete
* @param {Object} definitions Server-side block definitions
[6929] Fix | Delete
*/
[6930] Fix | Delete
// eslint-disable-next-line camelcase
[6931] Fix | Delete
function unstable__bootstrapServerSideBlockDefinitions(definitions) {
[6932] Fix | Delete
const {
[6933] Fix | Delete
addBootstrappedBlockType
[6934] Fix | Delete
} = unlock((0,external_wp_data_namespaceObject.dispatch)(store));
[6935] Fix | Delete
for (const [name, blockType] of Object.entries(definitions)) {
[6936] Fix | Delete
addBootstrappedBlockType(name, blockType);
[6937] Fix | Delete
}
[6938] Fix | Delete
}
[6939] Fix | Delete
[6940] Fix | Delete
/**
[6941] Fix | Delete
* Gets block settings from metadata loaded from `block.json` file.
[6942] Fix | Delete
*
[6943] Fix | Delete
* @param {Object} metadata Block metadata loaded from `block.json`.
[6944] Fix | Delete
* @param {string} metadata.textdomain Textdomain to use with translations.
[6945] Fix | Delete
*
[6946] Fix | Delete
* @return {Object} Block settings.
[6947] Fix | Delete
*/
[6948] Fix | Delete
function getBlockSettingsFromMetadata({
[6949] Fix | Delete
textdomain,
[6950] Fix | Delete
...metadata
[6951] Fix | Delete
}) {
[6952] Fix | Delete
const allowedFields = ['apiVersion', 'title', 'category', 'parent', 'ancestor', 'icon', 'description', 'keywords', 'attributes', 'providesContext', 'usesContext', 'selectors', 'supports', 'styles', 'example', 'variations', 'blockHooks', 'allowedBlocks'];
[6953] Fix | Delete
const settings = Object.fromEntries(Object.entries(metadata).filter(([key]) => allowedFields.includes(key)));
[6954] Fix | Delete
if (textdomain) {
[6955] Fix | Delete
Object.keys(i18nBlockSchema).forEach(key => {
[6956] Fix | Delete
if (!settings[key]) {
[6957] Fix | Delete
return;
[6958] Fix | Delete
}
[6959] Fix | Delete
settings[key] = translateBlockSettingUsingI18nSchema(i18nBlockSchema[key], settings[key], textdomain);
[6960] Fix | Delete
});
[6961] Fix | Delete
}
[6962] Fix | Delete
return settings;
[6963] Fix | Delete
}
[6964] Fix | Delete
[6965] Fix | Delete
/**
[6966] Fix | Delete
* Registers a new block provided a unique name and an object defining its
[6967] Fix | Delete
* behavior. Once registered, the block is made available as an option to any
[6968] Fix | Delete
* editor interface where blocks are implemented.
[6969] Fix | Delete
*
[6970] Fix | Delete
* For more in-depth information on registering a custom block see the
[6971] Fix | Delete
* [Create a block tutorial](https://developer.wordpress.org/block-editor/getting-started/create-block/).
[6972] Fix | Delete
*
[6973] Fix | Delete
* @param {string|Object} blockNameOrMetadata Block type name or its metadata.
[6974] Fix | Delete
* @param {Object} settings Block settings.
[6975] Fix | Delete
*
[6976] Fix | Delete
* @example
[6977] Fix | Delete
* ```js
[6978] Fix | Delete
* import { __ } from '@wordpress/i18n';
[6979] Fix | Delete
* import { registerBlockType } from '@wordpress/blocks'
[6980] Fix | Delete
*
[6981] Fix | Delete
* registerBlockType( 'namespace/block-name', {
[6982] Fix | Delete
* title: __( 'My First Block' ),
[6983] Fix | Delete
* edit: () => <div>{ __( 'Hello from the editor!' ) }</div>,
[6984] Fix | Delete
* save: () => <div>Hello from the saved content!</div>,
[6985] Fix | Delete
* } );
[6986] Fix | Delete
* ```
[6987] Fix | Delete
*
[6988] Fix | Delete
* @return {WPBlockType | undefined} The block, if it has been successfully registered;
[6989] Fix | Delete
* otherwise `undefined`.
[6990] Fix | Delete
*/
[6991] Fix | Delete
function registerBlockType(blockNameOrMetadata, settings) {
[6992] Fix | Delete
const name = isObject(blockNameOrMetadata) ? blockNameOrMetadata.name : blockNameOrMetadata;
[6993] Fix | Delete
if (typeof name !== 'string') {
[6994] Fix | Delete
console.error('Block names must be strings.');
[6995] Fix | Delete
return;
[6996] Fix | Delete
}
[6997] Fix | Delete
if (!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(name)) {
[6998] Fix | Delete
console.error('Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block');
[6999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function