跳到内容
新问题

对这个项目有疑问吗?注册一个免费的GitHub帐户以打开一个问题,并联系其维护者和社区。

单击“注册GitHub”,表示您同意我们的服务条款隐私声明。我们偶尔会向您发送与帐户相关的电子邮件。

已经在GitHub上了?登录到您的帐户

块绑定:允许在post元源中编辑 #61753

对话

桑托斯·吉拉莫特
复制链接
贡献者

@桑托斯·吉拉莫特 桑托斯·吉拉莫特 评论2024年5月17日

什么?

使用编辑器中对块绑定API的最新更改,允许用户在连接时直接通过块编辑自定义字段的值。例如,当段落内容绑定到特定的自定义字段,并且用户开始键入时,他们将修改自定义字段,而不是内容。

至少在第一次迭代中,它应限于:

  • 具有编辑字段权限的用户。
  • 当用户编辑文章而不是模板时。
  • 自定义字段不应通过REST API进行保护和可用。

怎么用?

使用setValue(设置值)基于由创建的代码的函数@埃拉特里克斯 在这里。除此之外,我们应该使用锁定属性编辑在这个pull请求中添加了回调,以覆盖上述限制。

此外,它还确保分割选择在绑定块中按预期工作。

测试说明

我为这个用例添加了几个e2e测试。您可以通过以下方式手动测试:

测试说明

1.通过将此代码段添加到主题的函数中来注册post meta。php
添加操作(_A)('初始化','测试块绑定');功能 测试块绑定() {寄存器_元数据('邮递','文本字段',阵列('显示_重置'=>真的,'单一的'=>真的,'类型'=>'一串','违约'=>'默认文本值',));}
2.使用代码编辑器添加绑定到自定义字段的段落块
<!-- wp:paragraph{“metadata”:{“bindings”:{“content”:{source:“core/post-meta”,“args”:}“key”:“text_field”}}}--><p>段落内容</p><!-- /wp:段落-->
  1. 检查是否显示了自定义字段的值。
  2. 选中可以在后期编辑器中编辑它。
  3. 检查修改值是否实际更改了自定义字段而不是段落内容。

@桑托斯·吉拉莫特 桑托斯·吉拉莫特补充[类型]功能 要在变更日志中突出显示的新功能。 [Feature]块绑定标签2024年5月17日
@桑托斯·吉拉莫特 桑托斯·吉拉莫特 用力推动的这个 try/allow-editing-in-post-meta-bindings(尝试/允许编辑) 分支 2a71c24 18电子6a5c 比较 2024年5月17日07:52
复制链接

github操作 机器人程序 评论2024年5月17日

尺寸变化:+264亿(+0.02%)

总大小:1.74 MB

文件名 大小 更改
build/block-editor/index.min.js 261千字节 +147亿(+0.06%)
build/block-library/index.min.js 218千字节 +40亿(+0.02%)
build/blocks/index.min.js 51.8千字节 +4亿(+0.01%)
build/editor/index.min.js 93.2千字节 +73 B(+0.08%)
ℹ️查看未更改
文件名 大小
build/a11y/index.min.js版本 955亿
build/annotations/index.min.js 2.27千字节
构建/api-fetch/index.min.js 2.32千字节
构建/auto/index.min.js 2.1千字节
build/blob/index.min.js 578亿
build/block-directory/index.min.js 7.29千字节
构建/块目录/样式-rtl.css 1.03千字节
构建/块目录/样式.css 1.03千字节
build/block-editor/content-rtl.css 4.58千字节
构建/块编辑器/内容.css 4.57千字节
构建/块编辑器/默认编辑器样式-rtl.css 395亿
构建/块编辑器/默认编辑器样式.css 395亿
build/block-editor/style-rtl.css 15.6千字节
构建/块编辑器/样式.css 15.6千字节
build/block-library/blocks/archives/editor-rtl.css 61亿
build/block-library/blocks/archives/editor.css 60亿
build/block-library/blocks/archives/style-rtl.css 90亿
build/block-library/blocks/archives/style.css 90亿
build/block-library/blocks/audio/editor-rtl.css 150亿
build/block-library/blocks/audio/editor.css 150亿
build/block-library/blocks/audio/style-rtl.css 122亿
build/block-library/blocks/audio/style.css 122亿
构建/block-library/blocks/audio/theme-rtl.css 126亿
构建/block-library/blocks/audio/theme.css 126亿
构建/块库/blocks/avatar/editor-rtl.css 116亿
build/block-library/blocks/avatar/editor.css 116亿
build/block-library/blocks/avatar/style-rtl.css 104亿
build/block-library/blocks/avatar/style.css 104亿
build/block-library/blocks/button/editor-rtl.css 307亿
构建/块库/blocks/button/editor.css 307亿
构建/块库/blocks/button/style-rtl.css 539亿
build/block-library/blocks/button/style.css 539亿
build/block-library/blocks/buttons/editor-rtl.css 337亿
build/block-library/blocks/buttons/editor.css 337亿
build/block-library/blocks/buttons/style-rtl.css 332亿
build/block-library/blocks/buttons/style.css 332亿
build/block-library/blocks/calendar/style-rtl.css 239亿
build/block-library/blocks/calendar/style.css 239亿
build/block-library/blocks/categories/editor-rtl.css 113亿
build/block-library/blocks/categories/editor.css 112亿
build/block-library/blocks/categories/style-rtl.css 124亿
build/block-library/blocks/categories/style.css 124亿
build/block-library/blocks/code/editor-rtl.css 53亿
build/block-library/blocks/code/editor.css 53亿
build/block-library/blocks/code/style-rtl.css 121亿
build/block-library/blocks/code/style.css 121亿
构建/block-library/blocks/code/theme-rtl.css 124亿
build/block-library/blocks/code/theme.css 124亿
build/block-library/blocks/columns/editor-rtl.css 108亿
build/block-library/blocks/columns/editor.css 108亿
构建/块库/blocks/columns/style-rtl.css 421亿
build/block-library/blocks/columns/style.css 421亿
build/block-library/blocks/comment-author-avatar/editor-rtl.css 125亿
build/block-library/blocks/comment-author-avatar/editor.css 125亿
build/block-library/blocks/comment-content/style-rtl.css 92亿
build/block-library/blocks/comment-content/style.css 92亿
build/block-library/blocks/comment-template/style-rtl.css 199亿
build/block-library/blocks/comment-template/style.css 198亿
build/block-library/blocks/comments-pagination-numbers/editor-rtl.css 123亿
build/block-library/blocks/comments-pagination-numbers/editor.css 121亿
build/block-library/blocks/comments-pagination/editor-rtl.css 222亿
build/block-library/blocks/comments-pageination/editor.css 209亿
build/block-library/blocks/comments-pagination/style-rtl.css 235亿
build/block-library/blocks/comments-pageination/style.css 231亿
build/block-library/blocks/comments-title/editor-rtl.css 75亿
构建/块库/块/注释标题/编辑器.css 75亿
build/block-library/blocks/comments/editor-rtl.css 840亿
build/block-library/blocks/comments/editor.css 839亿
build/block-library/blocks/comments/style-rtl.css 637亿
build/block-library/blocks/comments/style.css 636亿
build/block-library/blocks/cover/editor-rtl.css 667磅
构建/块库/blocks/cover/editor.css 670亿
build/block-library/blocks/cover/style-rtl.css 1.62千字节
build/block-library/blocks/cover/style.css 1.61千字节
build/block-library/blocks/details/editor-rtl.css 65亿
build/block-library/blocks/details/editor.css 65亿
build/block-library/blocks/details/style-rtl.css 86亿
build/block-library/blocks/details/style.css 86亿
build/block-library/blocks/embed/editor-rtl.css 312亿
build/block-library/blocks/embed/editor.css 312亿
build/block-library/blocks/embed/style-rtl.css 410亿
build/block-library/blocks/embed/style.css 410亿
build/block-library/blocks/embed/theme-rtl.css 126亿
build/block-library/blocks/embed/theme.css 126亿
build/block-library/blocks/file/editor-rtl.css 326磅
build/block-library/blocks/file/editor.css 327亿
build/block-library/blocks/file/style-rtl.css 280亿
build/block-library/blocks/file/style.css 281亿
build/block-library/blocks/file/view.min.js 324亿
构建/block-library/blocks/脚注/style-rtl.css 201亿
build/block-library/blocks/footnotes/style.css 199亿
build/block-library/blocks/form-input/editor-rtl.css 227亿
build/block-library/blocks/form-input/editor.css 227亿
构建/块库/blocks/form输入/style-rtl.css 343亿
build/block-library/blocks/form-input/style.css 343亿
build/block-library/blocks/form-submission-notification/editor-rtl.css 340亿
build/block-library/blocks/form-submission-notification/editor.css 340亿
build/block-library/blocks/form-submit-button/style-rtl.css 69亿
构建/块库/块/表单提交按钮/style.css 69亿
build/block-library/blocks/form/view.min.js 471亿
build/block-library/blocks/freeform/editor-rtl.css 2.61千字节
build/block-library/blocks/freeform/editor.css 2.61千字节
build/block-library/blocks/galletry/editor-rtl.css 962亿
build/block-library/blocks/galletry/editor.css 965亿
build/block-library/blocks/gallower/style-rtl.css 1.72千字节
build/block-library/blocks/gallower/style.css 1.72千字节
build/block-library/blocks/gallower/theme-rtl.css版本 108亿
build/block-library/blocks/gallery/主题.css 108亿
build/block-library/blocks/group/editor-rtl.css 403亿
build/block-library/blocks/group/editor.css 403亿
build/block-library/blocks/group/style-rtl.css 103亿
build/block-library/blocks/group/style.css 103亿
构建/块-库/块/组/主题-rtl.css 78亿
构建/块-库/块/组/主题.css 78亿
build/block-library/blocks/heading/style-rtl.css 189亿
build/block-library/blocks/heading/style.css 189亿
build/block-library/blocks/html/editor-rtl.css 346亿
构建/block-library/blocks/html/editor.css 347亿
build/block-library/blocks/image/editor-rtl.css 891亿
build/block-library/blocks/image/editor.css 891亿
build/block-library/blocks/image/style-rtl.css 1.52千字节
构建/块库/blocks/image/style.css 1.52千字节
构建/block-library/blocks/image/theme-rtl.css 137亿
构建/block-library/blocks/image/theme.css 137亿
build/block-library/blocks/image/view.min.js 1.54千字节
build/block-library/blocks/latest-comments/style-rtl.css 357亿
build/block-library/blocks/latest-comments/style.css 357亿
build/block-library/blocks/platest-posts/editor-rtl.css 205亿
build/block-library/blocks/platest-posts/editor.css 205亿
build/block-library/blocks/platest-posts/style-rtl.css 512亿
build/block-library/blocks/platest-posts/style.css 512亿
build/block-library/blocks/list/style-rtl.css 102亿
build/block-library/blocks/list/style.css 102亿
build/block-library/blocks/media-text/editor-rtl.css 306亿
build/block-library/blocks/media-text/editor.css 305亿
build/block-library/blocks/media-text/style-rtl.css 505亿
build/block-library/blocks/media-text/style.css 503亿
build/block-library/blocks/more/editor-rtl.css 431亿
build/block-library/blocks/more/editor.css 431亿
build/block-library/blocks/navigation-link/editor-rtl.css 668亿
build/block-library/blocks/navigation-link/editor.css 669亿
build/block-library/blocks/navigation-link/style-rtl.css 193亿
构建/块库/块/导航链接/style.css 192亿
build/block-library/blocks/navigation-submenu/editor-rtl.css 296亿
build/block-library/blocks/navigation-submenu/editor.css 295亿
build/block-library/blocks/navigation/editor-rtl.css 2.26千字节
构建/块库/blocks/navigation/editor.css 2.26千字节
build/block-library/blocks/navigation/style-rtl.css 2.26千字节
build/block-library/blocks/navigation/style.css 2.25千字节
build/block-library/blocks/navigation/view.min.js 1.03千字节
build/block-library/blocks/nextpage/editor-rtl.css 395亿
build/block-library/blocks/nextpage/editor.css 395亿
build/block-library/blocks/page-list/editor-rtl.css 377亿
build/block-library/blocks/page-list/editor.css 377亿
build/block-library/blocks/page-list/style-rtl.css 175亿
build/block-library/blocks/page-list/style.css 175亿
build/block-library/blocks/pragment/editor-rtl.css 235亿
build/block-library/blocks/pragment/editor.css 235亿
build/block-library/blocks/pragment/style-rtl.css 341亿
build/block-library/blocks/pragment/style.css 341亿
build/block-library/blocks/post-author/style-rtl.css 175亿
build/block-library/blocks/post-author/style.css 176亿
build/block-library/blocks/post-comments-form/editor-rtl.css 96亿
build/block-library/blocks/post-comments-form/editor.css 96亿
build/block-library/blocks/post-comments-form/style-rtl.css 508亿
构建/块库/块/发布评论表单/style.css 508亿
build/block-library/blocks/post-content/editor-rtl.css 74亿
build/block-library/blocks/post-content/editor.css 74亿
build/block-library/blocks/post-date/style-rtl.css 61亿
build/block-library/blocks/post-date/style.css 61亿
build/block-library/blocks/post-extract/editor-rtl.css 71亿
build/block-library/blocks/post-extract/editor.css 71个B
build/block-library/blocks/post-extract/style-rtl.css 141亿
build/block-library/blocks/post-extract/style.css 141亿
构建/块库/blocks/post featured image/editor-rtl.css 734亿
build/block-library/blocks/post-featured-image/editor.css 732亿
build/block-library/blocks/post-featured-image/style-rtl.css 342亿
build/block-library/blocks/post-featured-image/style.css 342亿
build/block-library/blocks/post-navigation-link/style-rtl.css 215亿
build/block-library/blocks/post-navigation-link/style.css 214亿
build/block-library/blocks/post-template/editor-rtl.css 99亿
build/block-library/blocks/post-template/editor.css 98亿
build/block-library/blocks/post-template/style-rtl.css 397亿
build/block-library/blocks/post-template/style.css 396亿
build/block-library/blocks/post-terms/style-rtl.css 96亿
build/block-library/blocks/post-terms/style.css 96亿
build/block-library/blocks/post-time-to-read/style-rtl.css 69亿
build/block-library/blocks/post-time-to-read/style.css 69亿
build/block-library/blocks/post-title/style-rtl.css 100亿
build/block-library/blocks/post-title/style.css 100亿
build/block-library/blocks/preactatted/style-rtl.css 125亿
build/block-library/blocks/preactatted/style.css 125亿
build/block-library/blocks/pullquote/editor-rtl.css 135亿
build/block-library/blocks/pullquote/editor.css 135亿
build/block-library/blocks/pullquote/style-rtl.css 344亿
build/block-library/blocks/pullquote/style.css 343亿
构建/block-library/blocks/pullquote/theme-rtl.css 168亿
构建/block-library/blocks/pullquote/theme.css 168亿
build/block-library/blocks/query-pagination-numbers/editor-rtl.css 122亿
build/block-library/blocks/query-pagination-numbers/editor.css 121亿
build/block-library/blocks/query-pagination/editor-rtl.css 221亿
build/block-library/blocks/query-pagination/editor.css 211亿
build/block-library/blocks/query-pagination/style-rtl.css 288亿
build/block-library/blocks/query-pagination/style.css 284亿
build/block-library/blocks/query-title/style-rtl.css 63亿
build/block-library/blocks/query-title/style.css 63亿
build/block-library/blocks/query/editor-rtl.css 486亿
build/block-library/blocks/query/editor.css 486亿
build/block-library/blocks/query/view.min.js 958亿
build/block-library/blocks/quote/style-rtl.css 237亿
build/block-library/blocks/quote/style.css 237亿
build/block-library/blocks/quote/theme-rtl.css 223亿
构建/block-library/blocks/quote/theme.css 226亿
build/block-library/blocks/read-more/style-rtl.css 140亿
build/block-library/blocks/read-more/style.css 140亿
build/block-library/blocks/rss/editor-rtl.css 101亿
build/block-library/blocks/rss/editor.css 101亿
构建/块库/blocks/rss/style-rtl.css 289亿
build/block-library/blocks/rss/style.css 288亿
build/block-library/blocks/search/editor-rtl.css 184亿
build/block-library/blocks/search/editor.css 184亿
构建/块库/blocks/search/style-rtl.css 690亿
build/block-library/blocks/search/style.css 689亿
构建/block-library/blocks/search/theme-rtl.css 114亿
构建/block-library/blocks/search/theme.css 114亿
build/block-library/blocks/search/view.min.js 478亿
build/block-library/blocks/seleparator/editor-rtl.css 99亿
build/block-library/blocks/seleparator/editor.css 99亿
build/block-library/blocks/seleparater/style-rtl.css 248亿
build/block-library/blocks/seleparater/style.css 248亿
build/block-library/blocks/seleparater/theme-rtl.css 194亿
build/block-library/blocks/seleparater/theme.css 194亿
build/block-library/blocks/shortcode/editor-rtl.css 286亿
build/block-library/blocks/shortcode/editor.css 286亿
build/block-library/blocks/site-logo/editor-rtl.css 805亿
build/block-library/blocks/site-logo/editor.css 805亿
build/block-library/blocks/site-logo/style-rtl.css 218亿
build/block-library/blocks/site-logo/style.css 218亿
build/block-library/blocks/site-tagline/editor-rtl.css 86亿
build/block-library/blocks/site-tagline/editor.css 86亿
build/block-library/blocks/site-title/editor-rtl.css 124亿
build/block-library/blocks/site-title/editor.css 124亿
build/block-library/blocks/site-title/style-rtl.css 70亿
build/block-library/blocks/site-title/style.css 70亿
build/block-library/blocks/social-link/editor-rtl.css 335亿
build/block-library/blocks/social-link/editor.css 335亿
构建/block-library/blocks/social-links/editor-rtl.css 683亿
构建/块库/块/社交链接/editor.css 681亿
build/block-library/blocks/social-links/style-rtl.css 1.51千字节
build/block-library/blocks/social-links/style.css 1.51千字节
build/block-library/blocks/spacer/editor-rtl.css 350亿
build/block-library/blocks/spacer/editor.css 350亿
build/block-library/blocks/spacer/style-rtl.css 48亿
build/block-library/blocks/spacer/style.css 48亿
build/block-library/blocks/table/editor-rtl.css 395亿
build/block-library/blocks/table/editor.css 395亿
build/block-library/blocks/table/style-rtl.css 639亿
build/block-library/blocks/table/style.css 639亿
build/block-library/blocks/table/theme-rtl.css 146亿
build/block-library/blocks/table/theme.css 146亿
build/block-library/blocks/tag-cloud/style-rtl.css 265亿
build/block-library/blocks/tag-cloud/style.css 266亿
build/block-library/blocks/template-part/editor-rtl.css 393亿
build/block-library/blocks/template-part/editor.css 393亿
build/block-library/blocks/template-part/theme-rtl.css 112亿
build/block-library/blocks/template-part/theme.css 112亿
build/block-library/blocks/term-description/style-rtl.css 111亿
build/block-library/blocks/term-description/style.css 111亿
构建/块库/blocks/text列/editor-rtl.css 95亿
build/block-library/blocks/text-columns/editor.css 95亿
build/block-library/blocks/text-columns/style-rtl.css 166亿
build/block-library/blocks/text-columns/style.css 166亿
构建/block-library/blocks/verse/style-rtl.css 99亿
build/block-library/blocks/verse/style.css 99亿
build/block-library/blocks/video/editor-rtl.css 552亿
build/block-library/blocks/video/editor.css 555亿
build/block-library/blocks/video/style-rtl.css 185亿
build/block-library/blocks/video/style.css 185亿
构建/block-library/blocks/video/theme-rtl.css 126亿
build/block-library/blocks/video/theme.css 126亿
build/block-library/classic-rtl.css 179亿
build/block-library/csss 179亿
build/block-library/common-rtl.css 1.11千字节
build/block-library/common.css 1.11千字节
build/block-library/editor-elements-rtl.css 75亿
build/block-library/editor-elements.css 75亿
build/block-library/editor-rtl.css 12千字节
build/block-library/editor.css 12千字节
构建/块-库/元素-rtl.css 54亿
build/block-library/elements.css 54亿
build/block-library/reset-rtl.css 472亿
build/block-library/reset.css 472亿
build/block-library/style-rtl.css 14.6千字节
build/block-library/style.css 14.6千字节
构建/块库/theme-rtl.css 703亿
构建/块-库/theme.css 706亿
build/block-serialization-default-parser/index.min.js 1.12千字节
build/block-serialization-specifi-parser/index.min.js 2.87千字节
build/commands/index.min.js 15.2千字节
build/commands/style-rtl.css 953亿
构建/命令/样式.css 951亿
build/components/index.min.js 222千字节
build/components/style-rtl.css 12千字节
build/components/style.css 12千字节
构建/撰写/索引min.js 12.8千字节
build/core-commands/index.min.js 2.71千字节
构建/core-data/index.min.js 72.5千字节
构建/定制e-widgets/index.min.js 10.9千字节
构建/自定义widgets/style-rtl.css 1.36千字节
构建/定制e-widgets/style.css 1.36千字节
构建/数据控制/索引.min.js 640亿
build/data/index.min.js 9.01千字节
构建/日期/索引.min.js 17.9千字节
build/deprecated/index.min.js 451亿
构建/dom-ready/index.min.js 324亿
构建/dom/index.min.js 4.65千字节
构建/编辑-发布/分类-rtl.css 578亿
构建/编辑post/classic.css 578亿
build/edit-post/index.min.js 13.4千字节
构建/编辑-发布/样式-rtl.css 2.35千字节
构建/编辑-发布/样式.css 2.35千字节
build/edit-site/index.min.js 210千字节
构建/编辑site/style-rtl.css 12千字节
构建/编辑site/style.css 12千字节
build/edit-widgets/index.min.js 17.5千字节
build/edit-widgets/style-rtl.css 4.21千字节
build/edit-widgets/style.css 4.21千字节
构建/编辑器/样式-rtl.css 8.86千字节
构建/编辑器/样式.css 8.87千字节
build/element/index.min.js 4.83千字节
build/escape-html/index.min.js 537亿
build/format-library/index.min.js 8.09千巴
build/format-library/style-rtl.css 493亿
构建/格式库/样式.css 492亿
build/hooks/index.min.js 1.55千字节
build/html-entities/index.min.js 448亿
构建/i18n/index.min.js 3.58千字节
构建/交互/调试.min.js 16.5千字节
构建/交互/文件.min.js 447亿
构建/交互/图像.min.js 1.67千字节
构建/交互性/index.min.js 13.3千字节
构建/交互/导航.min.js 1.17千字节
build/interactivity/query.min.js 740亿
构建/交互/路由.min.js 2.81千字节
构建/交互/搜索.min.js 618亿
构建/is-shallow-equal/index.min.js 527亿
构建/键盘快捷方式/index.min.js 1.31千字节
build/keycodes/index.min.js 1.46千字节
构建/list-reasable-blocks/index.min.js 2.14千字节
构建/list-rusable-blocks/style-rtl.css 851亿
build/list-rusable-blocks/style.css 851亿
build/media-utils/index.min.js 2.92千字节
build/modules/importmap-polyfill.min.js 12.2千字节
build/notices/index.min.js 948亿
build/nux/index.min.js 1.58千字节
构建/nux/style-rtl.css 748亿
build/nux/style.css 744亿
build/patterns/index.min.js 6.51千巴
build/patterns/style-rtl.css 595亿
构建/模式/样式.css 595亿
build/plugins/index.min.js 1.81千字节
构建/首选项持久性/index.min.js 2.06千字节
build/preferences/index.min.js 2.9千字节
build/preferences/style-rtl.css 719亿
build/preferences/style.css 721亿
build/primitives/index.min.js 831亿
build/priority-queue/index.min.js 1.52千字节
build/private-apis/index.min.js 1千字节
build/rect-i18n/index.min.js版本 629亿
build/react-refresh-entry/index.min.js 9.47千字节
build/react-refresh-runtime/index.min.js 6.78千字节
build/redux-routine/index.min.js 2.7千字节
构建/可重用块/index.min.js 2.72千巴
构建/可重用块/样式-rtl.css 256亿
构建/可重用块/样式.css 256亿
构建/rich-text/index.min.js 10.1千字节
build/router/index.min.js 1.96千字节
build/server-side-render/index.min.js 1.97千字节
build/shortcode/index.min.js 1.39千字节
build/style-engine/index.min.js 2.02千字节
构建/token-list/index.min.js 582亿
构建/url/index.min.js 3.74千字节
build/vendors/react-dom.min.js 42.8千字节
构建/供应商/rect-jsx-runtime.min.js 554亿
build/vendors/react.min.js 2.65千字节
build/viewport/index.min.js 964亿
build/warning/index.min.js 249亿
build/widgets/index.min.js 7.13千字节
构建/widgets/style-rtl.css 1.17千字节
构建/widgets/style.css 1.17千字节
构建/wordcount/index.min.js 1.02千字节

压缩尺寸作用

基础自动更改自 使用函数更新/阻止绑定锁定 大旅行箱 2024年5月17日08:47
@桑托斯·吉拉莫特 桑托斯·吉拉莫特 用力推动的这个 try/allow-editing-in-post-meta-bindings(尝试/允许编辑) 分支 292b7天 fae903b公司 比较 2024年5月17日10:58
@桑托斯·吉拉莫特
复制链接
贡献者 作者

按“Enter”添加新块时出现问题,并且未禁用富文本。我来看看。

@桑托斯·吉拉莫特
复制链接
贡献者 作者

按“Enter”添加新块时出现问题,并且未禁用富文本。

我认为问题的根源是当我们打电话给获取块属性它返回原始内容的值,而不是用自定义字段值修改的值。因此,当我们称之为在这里在期间__不稳定SplitSelection功能,这是不正确的,并且会导致一些问题。

不确定修改存储本身中的属性而不是使用当前挂钩是否有助于这方面的工作。

@桑托斯·吉拉莫特 桑托斯·吉拉莫特 用力推动的这个 try/allow-editing-in-post-meta-bindings(尝试/允许编辑) 分支 995607年 b3f4488号 比较 2024年5月21日12:26
@桑托斯·吉拉莫特 桑托斯·吉拉莫特将基本分支从 大旅行箱 try/move-bindings-logic-outside-hook 2024年5月21日12:26
@桑托斯·吉拉莫特
复制链接
贡献者 作者

我已将此分支重新设置为另一个拉请求因为它应该解决我在绑定块上按Enter键时遇到的问题。

},
} );
},
锁属性编辑({select,context,args}){
复制链接
成员

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

当我看到这个方法名时,我有点困惑,因为我认为它是一个锁定属性编辑的操作。哪些替代方案有助于更好地表达意图——检查连接的值是否可以更新?

复制链接
贡献者 作者

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

你说得对,这可能会让人困惑。我们可以将意图改为相反的。我想到了一些想法:

  • 允许编辑
  • can编辑源
  • canUpdateSource
  • canUpdateSourceValue

欢迎提出任何想法🙂

复制链接
成员

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

一个重要的考虑因素是,用户可能能够编辑源代码,但不一定能编辑所有帖子或单个字段,因为权限非常精细。我不知道这是否反映在客户身上。

我看到权限仅在具有canUserEditEntityRecord(用户编辑实体记录)实际上,can用户编辑值canEditValue(编辑值)可能会产生更好的共鸣。

复制链接
贡献者 作者

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

我已经把名字改成了can用户编辑值在中最新提交。在我看来它更好。无论如何,API仍然是私有的,所以如果需要,我们可以更改它。

一个重要的考虑因素是,用户可能能够编辑源代码,但不一定能编辑所有帖子或单个字段,因为权限非常精细。我不知道这是否反映在客户身上。

你的意思是说目前的条件可能还不够吗?我们假设如果这些条件是真的,用户可以编辑元字段:

  • 用户可以编辑当前帖子。
  • 元字段在REST API中公开。

我们还应该考虑什么?

复制链接
成员

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

我在想受保护的元数据函数,该函数允许过滤,但您是正确的,当单个元字段通过REST API为当前用户(及其角色)公开时,我们可以放心地假设他们可以编辑它👍🏻

复制链接

github操作 机器人程序 评论2024年5月26日

在中检测到片状测试570a4b2型.
一些测试通过,但尝试失败。失败可能与此提交无关,但仍会报告以供查看。请参见文档了解更多信息。

🔍 工作流运行URL:https://github.com/WordPress/gutenberg/actions/runs/9251566900
📝 报告的问题:

@桑托斯·吉拉莫特 桑托斯·吉拉莫特 用力推动的这个 try/allow-editing-in-post-meta-bindings(尝试/允许编辑) 分支 570a4b2型 数字35db11 比较 2024年5月28日09:02
@桑托斯·吉拉莫特 桑托斯·吉拉莫特将基本分支从 try/move-bindings-logic-outside-hook 大旅行箱 2024年5月28日09:03
@桑托斯·吉拉莫特 桑托斯·吉拉莫特 用力推动的这个 try/allow-editing-in-post-meta-bindings(尝试/允许编辑) 分支 9bfc757 7f8771e号 比较 2024年5月28日11:21
@桑托斯·吉拉莫特 桑托斯·吉拉莫特将基本分支从 大旅行箱 更新/创建-utils-for-block-bindings 2024年5月28日11:21
@桑托斯·吉拉莫特 桑托斯·吉拉莫特 用力推动的这个 try/allow-editing-in-post-meta-bindings(尝试/允许编辑) 分支 2012年a月8日 c72afda公司 比较 2024年5月30日08:50
@塔尔丹
复制链接
贡献者

@塔尔丹@凯文940726,如果能从您那里得到一个健全性检查,并确保Pattern Overrides的一切都能正常工作,那也太好了。目前,所有e2e测试都通过了,但我在开发过程中看到了一些失败,所以最好保持安全。

做了一些测试,我没有发现任何问题👍

registry.dispatch(noticesStore);
创建警告通知(
__(
“无法将块插入到具有绑定的其他块中”
复制链接
贡献者

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

您可以将段落粘贴到绑定段落中以更新其内容,对吗?

我可以在测试时这样做,因此在这种情况下,我们可以将警告更改为
不能将块插入到具有绑定的不同块中

复制链接
贡献者 作者

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

您可以将段落粘贴到绑定段落中以更新其内容,对吗?

嗯,我不这么认为。你可以粘贴一些文本,但如果你复制整个块,我想就不行了。

复制链接
成员

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

在我的测试中,这在很大程度上取决于您尝试粘贴块的时间。例如,尝试使用标题块、韵文块或图像块的标题。它将以不同的方式处理,而不会在UI中出现任何通知:

屏幕。记录2024-05-31.at.12.4.22.mov

实际上,我的建议是采取一些最适合给定场景的操作,跳过警告。

复制链接
贡献者 作者

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

理想情况下,我们可能想用应该粘贴的内容修改源值。但在这一点上,我觉得这有点棘手,我认为可以在后续公关中处理。这就是为什么我同时添加了警告。

);
回报;
}
dispatch.insertAfterBlock(selectionA.clientId);
复制链接
贡献者

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

建议的更改
dispatch.insertAfterBlock(selectionA.clientId);

我会把进入选项,是我们经过一些用户体验研究后可以在未来版本中添加的内容。

复制链接
贡献者

@卡布拉沃伯纳尔 卡布拉沃伯纳尔 留下了评论

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

按预期工作。除了进入行为。公共关系准备着陆。

@卡布拉沃伯纳尔 卡布拉沃伯纳尔被解雇的他们的陈旧的评论 2024年5月30日14:32

我发现,如果编辑自定义字段元框,编辑将停止。

复制链接
贡献者

@卡布拉沃伯纳尔 卡布拉沃伯纳尔 留下了评论

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

自定义字段编辑面板似乎从来没有与绑定一起很好地工作过,因此不应该成为此PR的块。

},
} );
},
canUserEditValue({select,context,args}){
复制链接
成员

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

这都是私事,对吧?

复制链接
成员

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

是的,注册块绑定源仍然是私有的。如果在WP 6.6周期中一切顺利,我们将向WP 6.7中的每个人开放。

复制链接
贡献者 作者

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

是的,我们将使用下一个周期来完善API。我想探索一些变化。

@吉奥罗牌手表
复制链接
成员

这与此公关无关,但我想表现出来,正如我在测试时注意到的那样:

屏幕截图2024-05-31,13 01 22

我试图在标题属性,但仍不包括。然而,它列在侧栏中。

@吉奥罗牌手表
复制链接
成员

吉奥罗牌手表 评论2024年5月31日

在我的测试中一切正常。看起来权限受到了尊重,所以当我以作者身份编辑文章时,当我使用Query块显示其他文章时,我无法修改我无权访问的字段的元值:

屏幕。记录2024-05-31.at.17.36.mov

总的来说,在为用户启用这个非常激动人心的功能后,我只能看到两个方面:

  • 重复粘贴行为的工作方式,但如块绑定:允许在post元源中编辑#61753(评论).
  • “按Enter键添加新块时出现问题,富文本未被禁用。”-该问题似乎已得到解决,工作正常。我唯一要注意的是用户对以下事实的感受:进入使用RichText时,在编辑文本中的任何位置创建一个新块并将焦点移动到那里。它与我测试的其他流似乎没有什么不同,比如在从列表视图触发的模式中键入URL或重命名块标题。
屏幕。记录2024-05-31.at.13.26.20.mov

复制链接
成员

@吉奥罗牌手表 吉奥罗牌手表 留下了评论

选择隐藏此评论的原因

将显示原因,以便向其他人描述此评论。了解更多信息.

把它带到终点线做得很好。看到内联编辑帖子元变得如此容易,这是非常令人兴奋的🎉

我使用管理员和作者角色进行了非常广泛的测试,所有支持的块类型都是:段落、标题、按钮和图像、产品和站点编辑器。我没有发现任何阻断剂。我会赞成在WordPress 6.6版本中包含它。

@桑托斯·吉拉莫特
复制链接
贡献者 作者

非常感谢您的广泛测试,格雷格!非常感谢☺️

我完全同意我们需要不断迭代“输入”和“粘贴”工作流,所以让我们密切关注这一点。此外,一旦发布,我们将获得有助于决策的社区反馈。

我试图在标题属性上设置绑定,但仍未覆盖。然而,它列在侧栏中。

关于这个,我刚刚创建了这个拉请求从绑定面板中删除它们。

@桑托斯·吉拉莫特 桑托斯·吉拉莫特合并提交8f74d5c进入之内 大旅行箱 2024年5月31日
79项检查中有77项通过
@桑托斯·吉拉莫特 桑托斯·吉拉莫特删除了 try/allow-editing-in-post-meta-bindings(尝试/允许编辑) 分支 2024年5月31日13:29
@github-操作 github操作 机器人程序将此添加到古腾堡18.5里程碑2024年5月31日
@前列腺增生 前列腺增生补充[类型]增强功能 改进建议。和已删除[类型]功能 要在变更日志中突出显示的新功能。标签2024年6月3日
卡斯廷轴子推送提交至卡斯廷加辛/古滕贝格引用的这个拉请求 2024年6月4日
*创建用于转换块属性的绑定实用程序*从商店获取属性和名称*更改函数以仅返回绑定属性*为块上下文添加action、selector和reducer*编辑组件中的同步存储*还原“编辑组件中的同步存储”这将恢复提交988c4b6号.*将逻辑移动到BlockContextProvider*更改父上下文逻辑*使用useLayoutEffect*返回到同步编辑组件中的存储*WIP:将绑定逻辑移动到`getBlockAttributes`*WIP:将绑定setAttributes逻辑移动到updateBlockBindings*仅将`select`传递给`getValue`函数*删除旧的编辑器挂钩*将回退添加到postId,直到上下文就绪*删除setValue后元代码*简化回退条件*更改绑定破坏*检查updateBlockAttributes中的canBindAttribute*更新单元测试以期望分派*在块中添加条件*不要在`getValue中使用`getBlockAttributes``*还原“在`getValue`中不使用`getBlockAttributes`”这将恢复提交0e91129号.*避免递归处理绑定*通过选择器访问上下文*更新getBlockAttributes逻辑*不要使用后备*添加post meta的编辑值可能性,添加函数检查是否为admin*还原“添加post meta的编辑值可能性,添加函数以检查是否为admin”这将恢复提交9659455.*段落块中允许测试编辑*受测试保护的字段不可编辑*Revert“为PHPCS嗅探启用并行处理(WordPress#61700)"这将恢复提交8331820.*添加post meta setValue函数*更新测试以检查内容是否可编辑*更新lockAttributesEditing默认值*将参数传递给lockAttributesEditing*检查用户是否可以编辑帖子元*检查字段在REST API中公开*禁用在模板中编辑*为postId添加回退*还原“还原”启用PHPCS嗅探的并行处理(WordPress#61700)""这将恢复提交电子74d71c.*调整旧测试*简化锁定属性编辑回退*上下文不使用回退*锁定控件时添加postType回退*在富文本中传递上下文*检查测试中的contenteditable属性*将名称更改为`canUserEditValue`*还原由重设基引起的更改*向后添加空格*通过富文本传递块上下文*更改导入*在拆分选择中将块属性转换为绑定*将上下文传递给正在使用的输入*更改REST API检查*使用getBoundAttributesValues*绑定属性时不拆分*还原由重设基引起的更改*编辑自定义字段时覆盖更多块*粘贴块时添加警告---------合著者:Carlos Bravo<carlos.bravo@automatic.com>
天井毒蛇推送提交至patil vipul/gutenberg引用的这个拉请求 2024年6月17日
*创建用于转换块属性的绑定实用程序*从商店获取属性和名称*更改函数以仅返回绑定属性*为块上下文添加action、selector和reducer*编辑组件中的同步存储*还原“编辑组件中的同步存储”这将恢复提交988c4b6号.*将逻辑移动到BlockContextProvider*更改父上下文逻辑*使用useLayoutEffect*返回到同步编辑组件中的存储*WIP:将绑定逻辑移动到`getBlockAttributes`*WIP:将绑定setAttributes逻辑移动到updateBlockBindings*仅将`select`传递给`getValue`函数*删除旧的编辑器挂钩*将回退添加到postId,直到上下文就绪*删除setValue后元代码*简化回退条件*更改绑定破坏*检查updateBlockAttributes中的canBindAttribute*更新单元测试以期望分派*在块中添加条件*不要在`getValue中使用`getBlockAttributes``*还原“在`getValue`中不使用`getBlockAttributes`”这将恢复提交0e91129号.*避免递归处理绑定*通过选择器访问上下文*更新getBlockAttributes逻辑*不要使用后备*添加post meta的编辑值可能性,添加函数检查是否为admin*还原“添加post meta的编辑值可能性,添加函数以检查是否为admin”这将恢复提交9659455.*段落块中允许测试编辑*受测试保护的字段不可编辑*Revert“为PHPCS嗅探启用并行处理(WordPress#61700)"这将恢复提交8331820.*添加post meta setValue函数*更新测试以检查内容是否可编辑*更新lockAttributesEditing默认值*将参数传递给lockAttributesEditing*检查用户是否可以编辑帖子元*检查字段在REST API中公开*禁用在模板中编辑*为postId添加回退*还原“还原”启用PHPCS嗅探的并行处理(WordPress#61700)""这将恢复提交电子74d71c.*调整旧测试*简化锁定属性编辑回退*上下文不使用回退*锁定控件时添加postType回退*在富文本中传递上下文*检查测试中的contenteditable属性*将名称更改为`canUserEditValue`*还原由重设基引起的更改*向后添加空格*通过富文本传递块上下文*更改导入*在拆分选择中将块属性转换为绑定*将上下文传递给正在使用的输入*更改REST API检查*使用getBoundAttributesValues*绑定属性时不拆分*还原由重设基引起的更改*编辑自定义字段时覆盖更多块*粘贴块时添加警告---------合著者:Carlos Bravo<carlos.bravo@automatic.com>
免费注册 在GitHub上加入此对话.已经有帐户了吗?登录以发表评论
项目
没有打开的项目
状态:多恩
开发

成功合并此请求可能会解决这些问题。

8名参与者