对于包含在 Gutenberg 插件中的功能,弃用政策旨在尽可能支持两个次要插件版本的向后兼容性。WordPress 稳定版本中包含的功能和代码不在此弃用时间线内,而是受 WordPress 项目的版本控制策略约束。当前的弃用项列于下方,并按它们将被完全移除的版本分组。如果您的插件依赖这些行为,您必须在注明的版本之前更新到推荐的替代方案。
未发布
wp.blocks.isValidBlockContent已被移除。请改用wp.blocks.validateBlock。
11.0.0
wp.blocks.registerBlockTypeFromMetadata方法已被移除。请改用wp.blocks.registerBlockType方法。
10.3.0
- 不再支持向
ActionItem.Slot组件传递带有asprop 的组件元组。请改为传递带有asprop 的单个组件。示例:
“`diff
<ActionItem.Slot
name=”my/slot”
label={ __( ‘My slot’ ) }- as={ [ MenuGroup, MenuItem ] }
- as={ MenuGroup }
/>
“`
9.7.0
InterfaceSkeleton组件中的leftSidebarprop 已被移除。请改用secondarySidebarprop。
8.6.0
- 区块 API 与 Block Context 的集成已更新。注册区块时,请在 JavaScript 文件中使用
usesContext和providesContext对,在 PHP 文件中使用uses_context和provides_context对,以取代之前的context和providesContext对。
8.3.0
- PHP 函数
gutenberg_get_post_from_context已被移除。请改用 Block Context。 - 旧的 Block Pattern APIs
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已被移除。 - 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已被移除。- 以下编辑器存储操作(actions)已被移除:
createNotice,removeNotice,createSuccessNotice,createInfoNotice,createErrorNotice,createWarningNotice。请使用来自@wordpress/notices模块的同名等效操作。 - wp.nux.DotTip 的 id prop 已被移除。请使用 tipId prop 代替。
wp.blocks.isValidBlock已被移除。请使用wp.blocks.isValidBlockContent代替,但请注意参数顺序已更改。wp.dataregistry.registerReducer已弃用。请使用registry.registerStore代替。wp.dataregistry.registerSelectors已弃用。请使用registry.registerStore代替。wp.dataregistry.registerActions已弃用。请使用registry.registerStore代替。wp.dataregistry.registerResolvers已弃用。请使用registry.registerStore代替。moment已从 date 模块的公共 API 中移除。
4.3.0
isEditorSidebarPanelOpened选择器(selector)(core/edit-post)已被移除。请使用isEditorPanelEnabled代替。toggleGeneralSidebarEditorPanel操作(action)(core/edit-post)已被移除。请使用toggleEditorPanelOpened代替。wp.components.PanelColor组件已被移除。请使用wp.editor.PanelColorSettings代替。wp.editor.PanelColor组件已被移除。请使用wp.editor.PanelColorSettings代替。
4.2.0
- 将解析器(resolvers)编写为异步生成器(async generators)的功能已被移除。请改用控件插件(controls plugin)。
wp.components.AccessibleSVG组件已被移除。请使用wp.components.SVG代替。wp.editor.UnsavedChangesWarning组件不再接受forceIsDirtyprop。setActiveMetaBoxLocations操作(action)(core/edit-post)已被移除。initializeMetaBoxState操作(action)(core/edit-post)已被移除。wp.editPost.initializeEditor不再返回一个对象。请使用setActiveMetaBoxLocations操作(action)(core/edit-post)来替代现有对象的initializeMetaBoxes函数。setMetaBoxSavedData操作(action)(core/edit-post)已被移除。getMetaBoxes选择器(selector)(core/edit-post)已被移除。请使用getActiveMetaBoxLocations选择器(selector)(core/edit-post)代替。getMetaBox选择器(selector)(core/edit-post)已被移除。请使用isMetaBoxLocationActive选择器(selector)(core/edit-post)代替。- 属性类型强制转换(Attribute type coercion)已被移除。省略源以通过序列化注释标记保留类型。
- 传递给
wp.editor.mediaUpload的onFileChange回调的对象中的mediaDetails。请使用media_details属性代替。 wp.components.CodeEditor已被移除。请直接使用wp.codeEditor。wp.blocks.setUnknownTypeHandlerName已被移除。请使用setFreeformContentHandlerName和setUnregisteredTypeHandlerName代替。wp.blocks.getUnknownTypeHandlerName已被移除。请使用getFreeformContentHandlerName和getUnregisteredTypeHandlerName代替。- 可重用区块(Reusable blocks)数据 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或_nx代替。wp.i18n.dcnpgettext已被移除。请使用__,_x,_n或_nx代替。
3.9.0
- RichText
getSettingsprop 已被移除。如果需要继续使用,可使用unstableGetSettingsprop。强烈不建议使用不稳定(Unstable)API,且它们可能在未经通知的情况下被移除。 - RichText
onSetupprop 已被移除。如果需要继续使用,可使用unstableOnSetupprop。强烈不建议使用不稳定(Unstable)API,且它们可能在未经通知的情况下被移除。 wp.editor.getColorName已被移除。请使用wp.editor.getColorObjectByColorValue代替。wp.editor.getColorClass已重命名。请使用wp.editor.getColorClassName代替。- 由
wp.editor.withColors传递的颜色对象中的value属性已被移除。请使用 color 属性代替。 - Subheading 区块已被移除。请使用 Paragraph 区块代替。
wp.blocks.getDefaultBlockForPostFormat已被移除。
3.8.0
wp.components.withContext已被移除。请使用wp.element.createContext代替。参见:https://react.dev/reference/react/createContext。wp.coreBlocks.registerCoreBlocks已被移除。请使用wp.blockLibrary.registerCoreBlocks代替。wp.editor.DocumentTitle组件已被移除。getDocumentTitle选择器(selector)(core/editor)已被移除。
3.7.0
wp.components.withAPIData已被移除。请改用 Core Data 模块或直接使用wp.apiFetch。wp.data.dispatch("core").receiveTerms已弃用。请使用wp.data.dispatch("core").receiveEntityRecords代替。getCategories解析器(resolver)已弃用。请使用getEntityRecords解析器(resolver)代替。wp.data.select("core").getTerms已弃用。请使用wp.data.select("core").getEntityRecords代替。wp.data.select("core").getCategories已弃用。请使用wp.data.select("core").getEntityRecords代替。wp.data.select("core").isRequestingCategories已弃用。请改用wp.data.select("core/data").isResolving。wp.data.select("core").isRequestingTerms已弃用。请改用wp.data.select("core").isResolving。wp.data.restrictPersistence、wp.data.setPersistenceStorage和wp.data.setupPersistence已被移除。请改用数据持久化插件。
3.6.0
wp.editor.editorMediaUpload已被移除。请改用wp.editor.mediaUpload。wp.utils.getMimeTypesArray已被移除。wp.utils.mediaUpload已被移除。请改用wp.editor.mediaUpload。wp.utils.preloadImage已被移除。supports.wideAlign已从 Block API 中移除。请改用supports.alignWide。wp.blocks.isSharedBlock已被移除。请改用wp.blocks.isReusableBlock。fetchSharedBlocksaction (core/editor) 已被移除。请改用fetchReusableBlocks。receiveSharedBlocksaction (core/editor) 已被移除。请改用receiveReusableBlocks。saveSharedBlockaction (core/editor) 已被移除。请改用saveReusableBlock。deleteSharedBlockaction (core/editor) 已被移除。请改用deleteReusableBlock。updateSharedBlockTitleaction (core/editor) 已被移除。请改用updateReusableBlockTitle。convertBlockToSavedaction (core/editor) 已被移除。请改用convertBlockToReusable。getSharedBlockselector (core/editor) 已被移除。请改用getReusableBlock。isSavingSharedBlockselector (core/editor) 已被移除。请改用isSavingReusableBlock。isFetchingSharedBlockselector (core/editor) 已被移除。请改用isFetchingReusableBlock。getSharedBlocksselector (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的引用均已替换为等效的clientIdprops 和 selectors。 wp.editor.MediaPlaceholder组件的onSelectUrlprop 已重命名为onSelectURL。wp.editor.UrlInput组件已重命名为wp.editor.URLInput。- Text Columns 区块已被移除。请改用 Columns 区块。
InnerBlocks分组布局已移除。请改用中间嵌套的内部区块作为替代方案。参考实现请见 Columns / Column 区块。RichText显式element格式已移除。请改用兼容的children格式。
3.4.0
Popover组件中的focusOnMountprop 已从仅接受Boolean更改为枚举风格属性,可接受"firstElement"、"container"或false。请将任何<Popover focusOnMount />用法转换为<Popover focusOnMount="firstElement" />。wp.utils.keycodes实用工具已移除。请改用wp.keycodes。edit函数中的区块idprop 已移除。请改用区块clientIdprop。propertysource 已移除。请改用等效的text、html或attributesource,或者使用注释属性。
3.3.0
useOnce: true已从 Block API 中移除。请改用supports.multiple: false。- 序列化组件时使用
componentWillMount生命周期方法。请改用构造函数。 blocks.Autocomplete.completersfilter 已移除。请改用editor.Autocomplete.completers。blocks.BlockEditfilter 已移除。请改用editor.BlockEdit。blocks.BlockListBlockfilter 已移除。请改用editor.BlockListBlock。blocks.MediaUploadfilter 已移除。请改用editor.MediaUpload。
3.2.0
wp.data.withRehydratation已重命名为wp.data.withRehydration。wp.editor.ImagePlaceholder组件已移除。请改用wp.editor.MediaPlaceholder。wp.utils.deprecated函数已移除。请改用wp.deprecated。wp.utils.blob已移除。请改用wp.blob。getInserterItems:allowedBlockTypes参数已移除,并添加了parentUID参数。getFrecentInserterItemsselector 已移除。请改用getInserterItems。getSupportedBlocksselector 已移除。请改用canInsertBlockType。
3.1.0
wp.blocks.*中的所有组件已移除。请改用wp.editor.*。wp.blocks.withEditorSettings已移除。请使用 data 模块访问编辑器设置wp.data.select( "core/editor" ).getEditorSettings()。wp.utils.*中的所有 DOM 实用工具已移除。请改用wp.dom.*。isPrivate: true已从 Block API 中移除。请改用supports.inserter: false。wp.utils.isExtraSmall函数已移除。请改用wp.viewport模块。getEditedPostExcerptselector 已移除 (core/editor)。请改用getEditedPostAttribute( 'excerpt' )。
3.0.0
wp.blocks.registerCoreBlocks函数已移除。请改用wp.coreBlocks.registerCoreBlocks。RichText的原始 TinyMCE 事件处理程序已弃用。请改用文档记录的 props、祖先事件处理程序或通过 onSetup 访问内部编辑器实例的事件中心。
2.8.0
wp.components.Autocomplete中原来的自动补全接口已更新。请改用最新的自动补全接口。更多信息请参阅autocomplete。getInserterItems:allowedBlockTypes参数现在是必填项。getFrecentInserterItems:allowedBlockTypes参数现在是必填项。
2.7.0
wp.element.getWrapperDisplayName函数已移除。请改用wp.element.createHigherOrderComponent。
2.6.0
wp.blocks.getBlockDefaultClassname函数已移除。请改用wp.blocks.getBlockDefaultClassName。wp.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.*匹配器已移除。请改用声明性属性。更多信息请参阅block attributes。wp.data.select( 'selector', ...args )已移除。请改用wp.data.select( reducerKey' ).*。wp.blocks.MediaUploadButton组件已移除。请改用wp.blocks.MediaUpload组件。