Make WordPress Core


Ignore:
Timestamp:
07/08/2022 12:32:37 PM (2 years ago)
Author:
gziolo
Message:

Tools: Automate backporting core blocks from Gutenberg to Core

Syncing stable blocks from the Gutenberg repository to wordpress-develop was a manual process, but it got automated with the script that runs together with syncing WordPress packages changed in the Gutenberg package.

Props zieladam.
Fixes #56179.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/index.php

    r53633 r53688  
    66 */
    77
     8define( 'BLOCKS_PATH', ABSPATH . WPINC . '/blocks/' );
     9
    810// Include files required for core blocks registration.
    9 require ABSPATH . WPINC . '/blocks/archives.php';
    10 require ABSPATH . WPINC . '/blocks/avatar.php';
    11 require ABSPATH . WPINC . '/blocks/block.php';
    12 require ABSPATH . WPINC . '/blocks/calendar.php';
    13 require ABSPATH . WPINC . '/blocks/categories.php';
    14 require ABSPATH . WPINC . '/blocks/comment-author-name.php';
    15 require ABSPATH . WPINC . '/blocks/comment-content.php';
    16 require ABSPATH . WPINC . '/blocks/comment-date.php';
    17 require ABSPATH . WPINC . '/blocks/comment-edit-link.php';
    18 require ABSPATH . WPINC . '/blocks/comment-reply-link.php';
    19 require ABSPATH . WPINC . '/blocks/comment-template.php';
    20 require ABSPATH . WPINC . '/blocks/comments-pagination.php';
    21 require ABSPATH . WPINC . '/blocks/comments-pagination-next.php';
    22 require ABSPATH . WPINC . '/blocks/comments-pagination-numbers.php';
    23 require ABSPATH . WPINC . '/blocks/comments-pagination-previous.php';
    24 require ABSPATH . WPINC . '/blocks/comments-title.php';
    25 require ABSPATH . WPINC . '/blocks/cover.php';
    26 require ABSPATH . WPINC . '/blocks/file.php';
    27 require ABSPATH . WPINC . '/blocks/gallery.php';
    28 require ABSPATH . WPINC . '/blocks/home-link.php';
    29 require ABSPATH . WPINC . '/blocks/image.php';
    30 require ABSPATH . WPINC . '/blocks/latest-comments.php';
    31 require ABSPATH . WPINC . '/blocks/latest-posts.php';
    32 require ABSPATH . WPINC . '/blocks/legacy-widget.php';
    33 require ABSPATH . WPINC . '/blocks/loginout.php';
    34 require ABSPATH . WPINC . '/blocks/navigation.php';
    35 require ABSPATH . WPINC . '/blocks/navigation-link.php';
    36 require ABSPATH . WPINC . '/blocks/navigation-submenu.php';
    37 require ABSPATH . WPINC . '/blocks/page-list.php';
    38 require ABSPATH . WPINC . '/blocks/pattern.php';
    39 require ABSPATH . WPINC . '/blocks/post-author.php';
    40 require ABSPATH . WPINC . '/blocks/post-author-biography.php';
    41 require ABSPATH . WPINC . '/blocks/post-comments.php';
    42 require ABSPATH . WPINC . '/blocks/post-comments-form.php';
    43 require ABSPATH . WPINC . '/blocks/post-content.php';
    44 require ABSPATH . WPINC . '/blocks/post-date.php';
    45 require ABSPATH . WPINC . '/blocks/post-excerpt.php';
    46 require ABSPATH . WPINC . '/blocks/post-featured-image.php';
    47 require ABSPATH . WPINC . '/blocks/post-navigation-link.php';
    48 require ABSPATH . WPINC . '/blocks/post-template.php';
    49 require ABSPATH . WPINC . '/blocks/post-terms.php';
    50 require ABSPATH . WPINC . '/blocks/post-title.php';
    51 require ABSPATH . WPINC . '/blocks/query.php';
    52 require ABSPATH . WPINC . '/blocks/query-no-results.php';
    53 require ABSPATH . WPINC . '/blocks/query-pagination.php';
    54 require ABSPATH . WPINC . '/blocks/query-pagination-next.php';
    55 require ABSPATH . WPINC . '/blocks/query-pagination-numbers.php';
    56 require ABSPATH . WPINC . '/blocks/query-pagination-previous.php';
    57 require ABSPATH . WPINC . '/blocks/query-title.php';
    58 require ABSPATH . WPINC . '/blocks/read-more.php';
    59 require ABSPATH . WPINC . '/blocks/rss.php';
    60 require ABSPATH . WPINC . '/blocks/search.php';
    61 require ABSPATH . WPINC . '/blocks/shortcode.php';
    62 require ABSPATH . WPINC . '/blocks/site-logo.php';
    63 require ABSPATH . WPINC . '/blocks/site-tagline.php';
    64 require ABSPATH . WPINC . '/blocks/site-title.php';
    65 require ABSPATH . WPINC . '/blocks/social-link.php';
    66 require ABSPATH . WPINC . '/blocks/tag-cloud.php';
    67 require ABSPATH . WPINC . '/blocks/template-part.php';
    68 require ABSPATH . WPINC . '/blocks/term-description.php';
    69 require ABSPATH . WPINC . '/blocks/widget-group.php';
     11require BLOCKS_PATH . 'legacy-widget.php';
     12require BLOCKS_PATH . 'widget-group.php';
     13require BLOCKS_PATH . 'require-dynamic-blocks.php';
    7014
    7115/**
     
    7620 */
    7721function register_core_block_types_from_metadata() {
    78     $block_folders = array(
    79         'audio',
    80         'button',
    81         'buttons',
    82         'code',
    83         'column',
    84         'columns',
    85         'comments-query-loop',
    86         'embed',
    87         'freeform',
    88         'group',
    89         'heading',
    90         'html',
    91         'list',
    92         'media-text',
    93         'missing',
    94         'more',
    95         'nextpage',
    96         'paragraph',
    97         'preformatted',
    98         'pullquote',
    99         'quote',
    100         'separator',
    101         'social-links',
    102         'spacer',
    103         'table',
    104         'text-columns',
    105         'verse',
    106         'video',
    107     );
    108 
     22    $block_folders = require BLOCKS_PATH . 'require-static-blocks.php';
    10923    foreach ( $block_folders as $block_folder ) {
    11024        register_block_type(
    111             ABSPATH . WPINC . '/blocks/' . $block_folder
     25            BLOCKS_PATH . $block_folder
    11226        );
    11327    }
Note: See TracChangeset for help on using the changeset viewer.