21 KiB
21 KiB
3.2.0
wp.data.withRehydratation已重命名为wp.data.withRehydrationwp.editor.ImagePlaceholder组件已移除,请改用wp.editor.MediaPlaceholderwp.utils.deprecated函数已移除,请改用wp.deprecatedwp.utils.blob已移除,请改用wp.blobgetInserterItems:移除了allowedBlockTypes参数,新增了parentUID参数getFrecentInserterItems选择器已移除,请改用getInserterItemsgetSupportedBlocks选择器已移除,请改用canInsertBlockType
3.1.0
wp.blocks.*中的所有组件已移除,请改用wp.editor.*wp.blocks.withEditorSettings已移除,请使用数据模块访问编辑器设置wp.data.select( "core/editor" ).getEditorSettings()wp.utils.*中的所有 DOM 工具已移除,请改用wp.dom.*- 区块 API 中的
isPrivate: true已移除,请改用supports.inserter: false wp.utils.isExtraSmall函数已移除,请改用wp.viewport模块getEditedPostExcerpt选择器已移除(core/editor),请改用getEditedPostAttribute( 'excerpt' )
3.0.0
wp.blocks.registerCoreBlocks函数已移除,请改用wp.coreBlocks.registerCoreBlocksRichText的原始 TinyMCE 事件处理程序已弃用,请改用文档化属性、祖先事件处理程序,或通过 onSetup 访问内部编辑器实例事件中心
2.8.0
wp.components.Autocomplete中的原始自动补全接口已更新,请改用最新自动补全接口。更多信息请参阅自动补全文档getInserterItems:allowedBlockTypes参数现为必填项getFrecentInserterItems:allowedBlockTypes参数现为必填项
2.7.0
wp.element.getWrapperDisplayName函数已移除,请改用wp.element.createHigherOrderComponent
2.6.0
wp.blocks.getBlockDefaultClassname函数已移除,请改用wp.blocks.getBlockDefaultClassNamewp.blocks.Editable组件已移除,请改用wp.blocks.RichText组件
2.5.0
- 不再支持从区块
save返回原始 HTML,请改用wp.element.RawHTML组件 wp.data.query高阶组件已移除,请改用wp.data.withSelect
2.4.0
wp.blocks.BlockDescription组件已移除,请改用description区块属性wp.blocks.InspectorControls.*组件已移除,请改用wp.components.*组件wp.blocks.source.*匹配器已移除,请改用声明式属性。更多信息请参阅区块属性文档wp.data.select( 'selector', ...args )已移除,请改用wp.data.select( reducerKey' ).*wp.blocks.MediaUploadButton组件已移除,请改用wp.blocks.MediaUpload组件
## 3.6.0
- 已移除 `wp.editor.editorMediaUpload`,请改用 `wp.editor.mediaUpload`
- 已移除 `wp.utils.getMimeTypesArray`
- 已移除 `wp.utils.mediaUpload`,请改用 `wp.editor.mediaUpload`
- 已移除 `wp.utils.preloadImage`
- 区块 API 中的 `supports.wideAlign` 已移除,请改用 `supports.alignWide`
- 已移除 `wp.blocks.isSharedBlock`,请改用 `wp.blocks.isReusableBlock`
- 已移除 fetchSharedBlocks 操作(`core/editor`),请改用 fetchReusableBlocks
- 已移除 receiveSharedBlocks 操作(`core/editor`),请改用 receiveReusableBlocks
- 已移除 saveSharedBlock 操作(`core/editor`),请改用 saveReusableBlock
- 已移除 deleteSharedBlock 操作(`core/editor`),请改用 deleteReusableBlock
- 已移除 updateSharedBlockTitle 操作(`core/editor`),请改用 updateReusableBlockTitle
- 已移除 convertBlockToSaved 操作(`core/editor`),请改用 convertBlockToReusable
- 已移除 getSharedBlock 选择器(`core/editor`),请改用 getReusableBlock
- 已移除 isSavingSharedBlock 选择器(`core/editor`),请改用 isSavingReusableBlock
- 已移除 isFetchingSharedBlock 选择器(`core/editor`),请改用 isFetchingReusableBlock
- 已移除 getSharedBlocks 选择器(`core/editor`),请改用 getReusableBlocks
## 3.5.0
- 已移除 `wp.components.ifCondition`,请改用 `wp.compose.ifCondition`
- 已移除 `wp.components.withGlobalEvents`,请改用 `wp.compose.withGlobalEvents`
- 已移除 `wp.components.withInstanceId`,请改用 `wp.compose.withInstanceId`
- 已移除 `wp.components.withSafeTimeout`,请改用 `wp.compose.withSafeTimeout`
- 已移除 `wp.components.withState`,请改用 `wp.compose.withState`
- 已移除 `wp.element.pure`,请改用 `wp.compose.pure`
- 已移除 `wp.element.compose`,请改用 `wp.compose.compose`
- 已移除 `wp.element.createHigherOrderComponent`,请改用 `wp.compose.createHigherOrderComponent`
- 已移除 `wp.utils.buildTermsTree`
- 已移除 `wp.utils.decodeEntities`,请改用 `wp.htmlEntities.decodeEntities`
- 所有区块 `uid` 的引用已替换为等效的 `clientId` 属性和选择器
- `wp.editor.MediaPlaceholder` 组件的 `onSelectUrl` 属性已重命名为 `onSelectURL`
- `wp.editor.UrlInput` 组件已重命名为 `wp.editor.URLInput`
- 已移除文本列区块,请改用列区块
- 已移除 `InnerBlocks` 分组布局,请改用中间嵌套内部区块。参考列/栏目块的实现方案
- 已移除 `RichText` 显式 `element` 格式,请改用兼容的 `children` 格式
## 3.4.0
- `Popover` 组件中的 `focusOnMount` 属性已从仅布尔值改为枚举式属性,接受 `"firstElement"`、`"container"` 或 `false`。请将 `<Popover focusOnMount />` 用法转换为 `<Popover focusOnMount="firstElement" />`
- 已移除 `wp.utils.keycodes` 工具,请改用 `wp.keycodes`
- 已移除 `edit` 函数中的区块 `id` 属性,请改用区块 `clientId` 属性
- 已移除 `property` 源,请改用等效的 `text`、`html` 或 `attribute` 源,或注释属性
## 3.3.0
- 已从区块 API 中移除 `useOnce: true`,请改用 `supports.multiple: false`
- 使用 `componentWillMount` 生命周期方法序列化组件,请改用构造函数
- 已移除 `blocks.Autocomplete.completers` 过滤器,请改用 `editor.Autocomplete.completers`
- 已移除 `blocks.BlockEdit` 过滤器,请改用 `editor.BlockEdit`
- 已移除 `blocks.BlockListBlock` 过滤器,请改用 `editor.BlockListBlock`
- 已移除 `blocks.MediaUpload` 过滤器,请改用 `editor.MediaUpload`
- PHP 函数
gutenberg_show_privacy_policy_help_text已被移除。 - PHP 函数
gutenberg_common_scripts_and_styles已被移除。请改用wp_common_block_scripts_and_styles。 - PHP 函数
gutenberg_enqueue_registered_block_scripts_and_styles已被移除。请改用wp_enqueue_registered_block_scripts_and_styles。 - PHP 函数
gutenberg_meta_box_save已被移除。 - PHP 函数
gutenberg_meta_box_save_redirect已被移除。 - PHP 函数
gutenberg_filter_meta_boxes已被移除。 - PHP 函数
gutenberg_intercept_meta_box_render已被移除。 - PHP 函数
gutenberg_override_meta_box_callback已被移除。 - PHP 函数
gutenberg_show_meta_box_warning已被移除。 - PHP 函数
the_gutenberg_metaboxes已被移除。请改用the_block_editor_meta_boxes。 - PHP 函数
gutenberg_meta_box_post_form_hidden_fields已被移除。请改用the_block_editor_meta_box_post_form_hidden_fields。 - PHP 函数
gutenberg_toggle_custom_fields已被移除。 - PHP 函数
gutenberg_collect_meta_box_data已被移除。请改用register_and_do_post_meta_boxes。 window._wpLoadGutenbergEditor已被移除。请改用window._wpLoadBlockEditor。注意:这是一个私有 API,不供公共使用,未来可能会被移除。- PHP 函数
gutenberg_get_script_polyfill已被移除。请改用wp_get_script_polyfill。 - PHP 函数
gutenberg_add_admin_body_class已被移除。如果需要将样式限定在块编辑器界面,请在样式表中使用.block-editor-page类选择器。
4.5.0
Dropdown.refresh()已被弃用,因为其包含的Popover现在会自动刷新。wp.editor.PostPublishPanelToggle已被弃用,请改用wp.editor.PostPublishButton。
4.4.0
wp.date.getSettings已被移除。请改用wp.date.__experimentalGetSettings。wp.compose.remountOnPropChange已被移除。- 以下编辑器存储操作已被移除:
createNotice、removeNotice、createSuccessNotice、createInfoNotice、createErrorNotice、createWarningNotice。请使用@wordpress/notices模块中同名的等效操作。 wp.nux.DotTip的id属性已被移除。请改用tipId属性。wp.blocks.isValidBlock已被移除。请改用wp.blocks.isValidBlockContent,但请注意参数顺序已更改。wp.data的registry.registerReducer已被弃用。请改用registry.registerStore。wp.data的registry.registerSelectors已被弃用。请改用registry.registerStore。wp.data的registry.registerActions已被弃用。请改用registry.registerStore。wp.data的registry.registerResolvers已被弃用。请改用registry.registerStore。moment已从日期模块的公共 API 中移除。
4.3.0
isEditorSidebarPanelOpened选择器(core/edit-post)已被移除。请改用isEditorPanelEnabled。toggleGeneralSidebarEditorPanel操作(core/edit-post)已被移除。请改用toggleEditorPanelOpened。wp.components.PanelColor组件已被移除。请改用wp.editor.PanelColorSettings。wp.editor.PanelColor组件已被移除。请改用wp.editor.PanelColorSettings。
4.2.0
- 已将异步生成器形式的解析器移除,请改用 controls 插件
wp.components.AccessibleSVG组件已移除,请改用wp.components.SVGwp.editor.UnsavedChangesWarning组件不再接受forceIsDirty属性setActiveMetaBoxLocations操作(core/edit-post)已移除initializeMetaBoxState操作(core/edit-post)已移除wp.editPost.initializeEditor不再返回对象,请使用setActiveMetaBoxLocations操作(core/edit-post)替代原对象的initializeMetaBoxes函数setMetaBoxSavedData操作(core/edit-post)已移除getMetaBoxes选择器(core/edit-post)已移除,请改用getActiveMetaBoxLocations选择器(core/edit-post)getMetaBox选择器(core/edit-post)已移除,请改用isMetaBoxLocationActive选择器(core/edit-post)- 属性类型强制转换已移除,需省略源以通过序列化注释标记保留类型
wp.editor.mediaUpload的onFileChange回调所传对象中的mediaDetails已移除,请改用media_details属性wp.components.CodeEditor已移除,请直接使用wp.codeEditorwp.blocks.setUnknownTypeHandlerName已移除,请改用setFreeformContentHandlerName和setUnregisteredTypeHandlerNamewp.blocks.getUnknownTypeHandlerName已移除,请改用getFreeformContentHandlerName和getUnregisteredTypeHandlerName- 可重用块数据 API 标记为实验性功能,未来可能变更
4.1.0
wp.data.dispatch( 'core/editor' ).checkTemplateValidity已移除,区块重置时会自动进行有效性验证
4.0.0
wp.editor.RichTextProvider已移除,请改用wp.data.select( 'core/editor' )方法wp.components.Draggable作为 DOM 节点拖拽处理器的功能已移除,请将wp.components.Draggable作为包装组件用于 DOM 节点拖拽处理器wp.i18n.getI18n已移除,请改用__、_x、_n或_nxwp.i18n.dcnpgettext已移除,请改用__、_x、_n或_nx
3.9.0
- RichText 的
getSettings属性已移除,如需继续使用请改用unstableGetSettings属性(强烈不建议使用不稳定 API,此类 API 可能随时被移除) - RichText 的
onSetup属性已移除,如需继续使用请改用unstableOnSetup属性(强烈不建议使用不稳定 API,此类 API 可能随时被移除) wp.editor.getColorName已移除,请改用wp.editor.getColorObjectByColorValuewp.editor.getColorClass已重命名,请改用wp.editor.getColorClassNamewp.editor.withColors所传颜色对象中的value属性已移除,请改用 color 属性- 子标题区块已移除,请改用段落区块
wp.blocks.getDefaultBlockForPostFormat已移除
3.8.0
wp.components.withContext已移除,请改用wp.element.createContext,参见:https://react.dev/reference/react/createContextwp.coreBlocks.registerCoreBlocks已移除,请改用wp.blockLibrary.registerCoreBlockswp.editor.DocumentTitle组件已移除getDocumentTitle选择器(core/editor)已移除
3.7.0
wp.components.withAPIData已移除,请直接使用核心数据模块或wp.apiFetchwp.data.dispatch("core").receiveTerms已弃用,请改用wp.data.dispatch("core").receiveEntityRecordsgetCategories解析器已弃用,请改用getEntityRecords解析器wp.data.select("core").getTerms已弃用,请改用wp.data.select("core").getEntityRecordswp.data.select("core").getCategories已弃用,请改用wp.data.select("core").getEntityRecordswp.data.select("core").isRequestingCategories已弃用,请改用wp.data.select("core/data").isResolvingwp.data.select("core").isRequestingTerms已弃用,请改用wp.data.select("core").isResolvingwp.data.restrictPersistence、wp.data.setPersistenceStorage和wp.data.setupPersistence已移除,请改用数据持久化插件
已弃用功能
对于Gutenberg插件中包含的功能,弃用政策旨在尽可能支持两个次要插件版本的向后兼容性。WordPress稳定版本中包含的功能和代码不在此弃用时间线内,而是遵循WordPress项目的版本管理政策。当前已弃用的功能如下所示,并按将完全移除这些功能的版本进行分组。如果您的插件依赖这些行为,则必须在指定版本之前更新至推荐的替代方案。
未发布版本
wp.blocks.isValidBlockContent已被移除。请改用wp.blocks.validateBlock。
11.0.0
wp.blocks.registerBlockTypeFromMetadata方法已被移除。请改用wp.blocks.registerBlockType方法。
10.3.0
- 不再支持向
ActionItem.Slot组件传递带有as属性的组件元组。请改为传递带有as属性的组件。示例:<ActionItem.Slot 名称="my/slot" 标签={ __( '我的插槽' ) } - 组件={ [ MenuGroup, MenuItem ] } + 组件={ MenuGroup } />
9.7.0
InterfaceSkeleton组件中的leftSidebar属性已被移除。请改用secondarySidebar属性。
8.6.0
- 更新了与区块上下文的区块API集成。注册区块时,请在JavaScript文件中使用
usesContext和providesContext对,在PHP文件中使用uses_context和provides_context对,而不是之前的context和providesContext对。
8.3.0
- PHP函数
gutenberg_get_post_from_context已被移除。请改用区块上下文。 - 旧的区块模式API
register_pattern/unregister_pattern已被移除。请改用新函数。
5.5.0
- PHP函数
gutenberg_init已被移除。 - PHP函数
is_gutenberg_page已被移除。请改用WP_Screen::is_block_editor。 - PHP函数
the_gutenberg_project已被移除。 - PHP函数
gutenberg_default_post_format_template已被移除。 - PHP函数
gutenberg_get_available_image_sizes已被移除。 - PHP函数
gutenberg_get_autosave_newer_than_post_save已被移除。 - PHP函数
gutenberg_editor_scripts_and_styles已被移除。
5.4.0
- PHP函数
gutenberg_load_plugin_textdomain已被移除。 - PHP函数
gutenberg_get_jed_locale_data已被移除。 - PHP函数
gutenberg_load_locale_data已被移除。
5.3.0
- PHP函数
gutenberg_redirect_to_classic_editor_when_saving_posts已被移除。 - PHP函数
gutenberg_revisions_link_to_editor已被移除。 - PHP函数
gutenberg_remember_classic_editor_when_saving_posts已被移除。 - PHP函数
gutenberg_can_edit_post_type已被移除。请改用use_block_editor_for_post_type。 - PHP函数
gutenberg_can_edit_post已被移除。请改用use_block_editor_for_post。
5.2.0
- PHP函数
gutenberg_parse_blocks已被移除。请改用parse_blocks。 - PHP函数
get_dynamic_blocks_regex已被移除。 - PHP函数
gutenberg_render_block已被移除。请改用render_block。 - PHP函数
strip_dynamic_blocks已被移除。如需用于摘要准备,请考虑改用excerpt_remove_blocks。 - PHP函数
strip_dynamic_blocks_add_filter已被移除。 - PHP函数
strip_dynamic_blocks_remove_filter已被移除。 - PHP函数
gutenberg_post_has_blocks已被移除。请改用has_blocks。 - PHP函数
gutenberg_content_has_blocks已被移除。请改用has_blocks。 - PHP函数
gutenberg_register_rest_routes已被移除。 - PHP函数
gutenberg_add_taxonomy_visibility_field已被移除。 - PHP函数
gutenberg_get_taxonomy_visibility_data已被移除。 - PHP函数
gutenberg_add_permalink_template_to_posts已被移除。 - PHP函数
gutenberg_add_block_format_to_post_content已被移除。 - PHP函数
gutenberg_add_target_schema_to_links已被移除。 - PHP函数
gutenberg_register_post_prepare_functions已被移除。 - PHP函数
gutenberg_silence_rest_errors已被移除。 - PHP函数
gutenberg_filter_post_type_labels已被移除。 - PHP函数
gutenberg_preload_api_request已被移除。请改用rest_preload_api_request。 - PHP函数
gutenberg_remove_wpcom_markdown_support已被移除。 - PHP函数
gutenberg_add_gutenberg_post_state已被移除。 - PHP函数
gutenberg_bulk_post_updated_messages已被移除。 - PHP函数
gutenberg_kses_allowedtags已被移除。 - PHP函数
gutenberg_add_responsive_body_class已被移除。 - PHP函数
gutenberg_add_edit_link_filters已被移除。 - PHP函数
gutenberg_add_edit_link已被移除。 - PHP函数
gutenberg_block_bulk_actions已被移除。 - PHP函数
gutenberg_replace_default_add_new_button已被移除。 - PHP函数
gutenberg_content_block_version已被移除。请改用block_version。 - PHP函数
gutenberg_get_block_categories已被移除。请改用get_block_categories。 - PHP函数
register_tinymce_scripts已被移除。请改用wp_register_tinymce_scripts。 - PHP函数
gutenberg_register_post_types已被移除。 gutenberg主题支持选项已被移除。请改用align-wide。- PHP函数
gutenberg_prepare_blocks_for_js已被移除。请改用get_block_editor_server_block_settings。 - PHP函数
gutenberg_load_list_reusable_blocks已被移除。 - PHP函数
_gutenberg_utf8_split已被移除。请改用_mb_substr。 - PHP函数
gutenberg_disable_editor_settings_wpautop已被移除。 - PHP函数
gutenberg_add_rest_nonce_to_heartbeat_response_headers已被移除。 - PHP函数
gutenberg_check_if_classic_needs_warning_about_blocks已被移除。 - PHP函数
gutenberg_warn_classic_about_blocks已被移除。