制作WordPress核心

变更集53688


忽略:
时间戳:
07/08/2022 12:32:37 PM (2周前)
作者:
gziolo
信息:

工具:自动将核心块从Gutenberg移植到core

将稳定块从Gutenberg存储库同步到WordPress -develop是一个手动过程,但是随着脚本在Gutenberg包中与同步WordPress包一起运行,它变得自动化了。

道具zieladam。
修复# 56179

地点:
树干
文件:
4添加
4编辑

传说:

未修改的
添加
删除
  • 树干/ Gruntfile.js

    r53378 r53688
    1247 1247 * /
    1248 1248 run('wp-packages:refresh-deps');
    1249
    1250 //生成src/目录下的文件
    1251 run('build');
    1252 1249 });
    1253 1250
    1699 1696 });
    1700 1697
    1698 咕哝。registerTask('wp-packages:sync-stable-blocks', '刷新PHP文件引用稳定@wordpress/block-library块。',函数(){
    1699 grunt.log。writeln('从@wordpress/block-library同步稳定块到src/ ');
    1700 Const {main} = require('。/工具/释放/ sync-stable-blocks”);
    1701 main ();
    1702 });
    1703
    1701 1704 //补丁任务。
    1702 1705 咕哝。renameTask(“patch_wordpress”、“补丁”);
  • 树干/ package.json

    r53662 r53688
    176 176 "test:e2e": "node ./tests/e2e/run-tests.js",
    177 177 "test:visual": "node ./tests/visual-regression/run-tests.js",
    178 "sync-gutenberg-packages -dev"
    178 "sync-gutenberg-packages": "sync-gutenberg-packages",
    179 "postsync-gutenberg-packages": "grunt wp-packages:sync-stable-blocks && grunt build -dev && grunt build"
    179 180 }
    180 181 }
  • 树干/ src / wp-includes /块/ index . php

    r53633 r53688
    6 6 * /
    7 7
    8 定义('BLOCKS_PATH', ABSPATH。WPINC。' /块/ ');
    9
    8 10 //包含核心块注册所需的文件。
    9 需要ABSPATH。WPINC。“/块/ archives.php”;
    10 需要ABSPATH。WPINC。“/块/ avatar.php”;
    11 需要ABSPATH。WPINC。“/块/ block.php”;
    12 需要ABSPATH。WPINC。“/块/ calendar.php”;
    13 需要ABSPATH。WPINC。“/块/ categories.php”;
    14 需要ABSPATH。WPINC。“/块/ comment-author-name.php”;
    15 需要ABSPATH。WPINC。“/块/ comment-content.php”;
    16 需要ABSPATH。WPINC。“/块/ comment-date.php”;
    17 需要ABSPATH。WPINC。“/块/ comment-edit-link.php”;
    18 需要ABSPATH。WPINC。“/块/ comment-reply-link.php”;
    19 需要ABSPATH。WPINC。“/块/ comment-template.php”;
    20. 需要ABSPATH。WPINC。“/块/ comments-pagination.php”;
    21 需要ABSPATH。WPINC。“/块/ comments-pagination-next.php”;
    22 需要ABSPATH。WPINC。“/块/ comments-pagination-numbers.php”;
    23 需要ABSPATH。WPINC。“/块/ comments-pagination-previous.php”;
    24 需要ABSPATH。WPINC。“/块/ comments-title.php”;
    25 需要ABSPATH。WPINC。“/块/ cover.php”;
    26 需要ABSPATH。WPINC。“/块/ file.php”;
    27 需要ABSPATH。WPINC。“/块/ gallery.php”;
    28 需要ABSPATH。WPINC。“/块/ home-link.php”;
    29 需要ABSPATH。WPINC。“/块/ image.php”;
    30. 需要ABSPATH。WPINC。“/块/ latest-comments.php”;
    31 需要ABSPATH。WPINC。“/块/ latest-posts.php”;
    32 需要ABSPATH。WPINC。“/块/ legacy-widget.php”;
    33 需要ABSPATH。WPINC。“/块/ loginout.php”;
    34 需要ABSPATH。WPINC。“/块/ navigation.php”;
    35 需要ABSPATH。WPINC。“/块/ navigation-link.php”;
    36 需要ABSPATH。WPINC。“/块/ navigation-submenu.php”;
    37 需要ABSPATH。WPINC。“/块/ page-list.php”;
    38 需要ABSPATH。WPINC。“/块/ pattern.php”;
    39 需要ABSPATH。WPINC。“/块/ post-author.php”;
    40 需要ABSPATH。WPINC。“/块/ post-author-biography.php”;
    41 需要ABSPATH。WPINC。“/块/ post-comments.php”;
    42 需要ABSPATH。WPINC。“/块/ post-comments-form.php”;
    43 需要ABSPATH。WPINC。“/块/ post-content.php”;
    44 需要ABSPATH。WPINC。“/块/ post-date.php”;
    45 需要ABSPATH。WPINC。“/块/ post-excerpt.php”;
    46 需要ABSPATH。WPINC。“/块/ post-featured-image.php”;
    47 需要ABSPATH。WPINC。“/块/ post-navigation-link.php”;
    48 需要ABSPATH。WPINC。“/块/ post-template.php”;
    49 需要ABSPATH。WPINC。“/块/ post-terms.php”;
    50 需要ABSPATH。WPINC。“/块/ post-title.php”;
    51 需要ABSPATH。WPINC。“/块/ query.php”;
    52 需要ABSPATH。WPINC。“/块/ query-no-results.php”;
    53 需要ABSPATH。WPINC。“/块/ query-pagination.php”;
    54 需要ABSPATH。WPINC。“/块/ query-pagination-next.php”;
    55 需要ABSPATH。WPINC。“/块/ query-pagination-numbers.php”;
    56 需要ABSPATH。WPINC。“/块/ query-pagination-previous.php”;
    57 需要ABSPATH。WPINC。“/块/ query-title.php”;
    58 需要ABSPATH。WPINC。“/块/ read-more.php”;
    59 需要ABSPATH。WPINC。“/块/ rss.php”;
    60 需要ABSPATH。WPINC。“/块/ search.php”;
    61 需要ABSPATH。WPINC。“/块/ shortcode.php”;
    62 需要ABSPATH。WPINC。“/块/ site-logo.php”;
    63 需要ABSPATH。WPINC。“/块/ site-tagline.php”;
    64 需要ABSPATH。WPINC。“/块/ site-title.php”;
    65 需要ABSPATH。WPINC。“/块/ social-link.php”;
    66 需要ABSPATH。WPINC。“/块/ tag-cloud.php”;
    67 需要ABSPATH。WPINC。“/块/ template-part.php”;
    68 需要ABSPATH。WPINC。“/块/ term-description.php”;
    69 需要ABSPATH。WPINC。“/块/ widget-group.php”;
    11 需要BLOCKS_PATH。“legacy-widget.php”;
    12 需要BLOCKS_PATH。“widget-group.php”;
    13 需要BLOCKS_PATH。“require-dynamic-blocks.php”;
    70 14
    71 15 / * *
    76 20. * /
    77 21 函数register_core_block_types_from_metadata() {
    78 $block_folders = array(
    79 “音频”,
    80 “按钮”,
    81 “按钮”,
    82 “代码”,
    83 “列”,
    84 “列”,
    85 “comments-query-loop”,
    86 “嵌入”,
    87 “自由”,
    88 “集团”,
    89 “标题”,
    90 “html”,
    91 “列表”,
    92 “media-text”,
    93 “失踪”,
    94 “更多”,
    95 “全心全意”,
    96 “段”,
    97 “格式化”,
    98 “pullquote”,
    99 “引用”,
    One hundred. “分隔符”,
    101 “社会联系”,
    102 “间隔”,
    103 “表”,
    104 “文本列”,
    105 “节”,
    106 “视频”,
    107 );
    108
    22 $block_folders = require BLOCKS_PATH。“require-static-blocks.php”;
    109 23 Foreach ($block_folders作为$block_folder) {
    110 24 register_block_type (
    111 ABSPATH。WPINC。“/块/”。block_folder美元
    25 BLOCKS_PATH。block_folder美元
    112 26 );
    113 27 }
  • 树干/测试/ phpunit) / /显然也包括

    r53635 r53688
    333 333 * /
    334 334 函数_unhook_block_registration() {
    335 Remove_action ('init', 'register_block_core_archives');
    336 Remove_action ('init', 'register_block_core_avatar');
    337 Remove_action ('init', 'register_block_core_block');
    338 Remove_action ('init', 'register_block_core_calendar');
    339 Remove_action ('init', 'register_block_core_categories');
    340 Remove_action ('init', 'register_block_core_comment_author_name');
    341 Remove_action ('init', 'register_block_core_comment_content');
    342 Remove_action ('init', 'register_block_core_comment_date');
    343 Remove_action ('init', 'register_block_core_comment_edit_link');
    344 Remove_action ('init', 'register_block_core_comment_reply_link');
    345 Remove_action ('init', 'register_block_core_comment_template');
    346 Remove_action ('init', 'register_block_core_comments_pagination');
    347 Remove_action ('init', 'register_block_core_comments_pagination_next');
    348 Remove_action ('init', 'register_block_core_comments_pagination_numbers');
    349 Remove_action ('init', 'register_block_core_comments_pagination_previous');
    350 Remove_action ('init', 'register_block_core_comments_title');
    351 Remove_action ('init', 'register_block_core_cover');
    352 Remove_action ('init', 'register_block_core_file');
    353 Remove_action ('init', 'register_block_core_gallery');
    354 Remove_action ('init', 'register_block_core_home_link');
    355 Remove_action ('init', 'register_block_core_image');
    356 Remove_action ('init', 'register_block_core_latest_comments');
    357 Remove_action ('init', 'register_block_core_latest_posts');
    335 require __DIR__。' / unregister-blocks-hooks.php ';
    336 Remove_action ('init', 'register_core_block_types_from_metadata');
    358 337 Remove_action ('init', 'register_block_core_legacy_widget');
    359 Remove_action ('init', 'register_block_core_loginout');
    360 Remove_action ('init', 'register_block_core_navigation');
    361 Remove_action ('init', 'register_block_core_navigation_link');
    362 Remove_action ('init', 'register_block_core_navigation_submenu');
    363 Remove_action ('init', 'register_block_core_page_list');
    364 Remove_action ('init', 'register_block_core_pattern');
    365 Remove_action ('init', 'register_block_core_post_author');
    366 Remove_action ('init', ' register_block_core_post_author_传记');
    367 Remove_action ('init', 'register_block_core_post_comments');
    368 Remove_action ('init', 'register_block_core_post_comments_form');
    369 Remove_action ('init', 'register_block_core_post_content');
    370 Remove_action ('init', 'register_block_core_post_date');
    371 Remove_action ('init', ' register_block_core_post_摘录');
    372 Remove_action ('init', 'register_block_core_post_featured_image');
    373 Remove_action ('init', 'register_block_core_post_navigation_link');
    374 Remove_action ('init', 'register_block_core_post_template');
    375 Remove_action ('init', 'register_block_core_post_terms');
    376 Remove_action ('init', 'register_block_core_post_title');
    377 Remove_action ('init', 'register_block_core_query');
    378 Remove_action ('init', 'register_block_core_query_no_results');
    379 Remove_action ('init', 'register_block_core_query_pagination');
    380 Remove_action ('init', 'register_block_core_query_pagination_next');
    381 Remove_action ('init', 'register_block_core_query_pagination_numbers');
    382 Remove_action ('init', 'register_block_core_query_pagination_previous');
    383 Remove_action ('init', 'register_block_core_query_title');
    384 Remove_action ('init', 'register_block_core_read_more');
    385 Remove_action ('init', 'register_block_core_rss');
    386 Remove_action ('init', 'register_block_core_search');
    387 Remove_action ('init', 'register_block_core_shortcode');
    388 Remove_action ('init', 'register_block_core_site_logo');
    389 Remove_action ('init', 'register_block_core_site_tagline');
    390 Remove_action ('init', 'register_block_core_site_title');
    391 Remove_action ('init', 'register_block_core_social_link');
    392 Remove_action ('init', 'register_block_core_tag_cloud');
    393 Remove_action ('init', 'register_block_core_template_part');
    394 Remove_action ('init', 'register_block_core_term_description');
    395 338 Remove_action ('init', 'register_block_core_widget_group');
    396 339 Remove_action ('init', 'register_core_block_types_from_metadata');
注意:看到TracChangeset有关使用变更集查看器的帮助。