[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/blocks/ -> index.php (source)

   1  <?php
   2  /**
   3   * Used to set up all core blocks used with the block editor.
   4   *
   5   * @package WordPress
   6   */
   7  
   8  // Include files required for core blocks registration.
   9  require ABSPATH . WPINC . '/blocks/archives.php';
  10  require ABSPATH . WPINC . '/blocks/block.php';
  11  require ABSPATH . WPINC . '/blocks/calendar.php';
  12  require ABSPATH . WPINC . '/blocks/categories.php';
  13  require ABSPATH . WPINC . '/blocks/latest-comments.php';
  14  require ABSPATH . WPINC . '/blocks/latest-posts.php';
  15  require ABSPATH . WPINC . '/blocks/rss.php';
  16  require ABSPATH . WPINC . '/blocks/search.php';
  17  require ABSPATH . WPINC . '/blocks/shortcode.php';
  18  require ABSPATH . WPINC . '/blocks/social-link.php';
  19  require ABSPATH . WPINC . '/blocks/tag-cloud.php';
  20  
  21  /**
  22   * Registers core block types using metadata files.
  23   * Dynamic core blocks are registered separately.
  24   *
  25   * @since 5.5.0
  26   */
  27  function register_core_block_types_from_metadata() {
  28      $block_folders = array(
  29          'audio',
  30          'button',
  31          'buttons',
  32          'classic',
  33          'code',
  34          'column',
  35          'columns',
  36          'embed',
  37          'file',
  38          'gallery',
  39          'group',
  40          'heading',
  41          'html',
  42          'image',
  43          'list',
  44          'media-text',
  45          'missing',
  46          'more',
  47          'nextpage',
  48          'paragraph',
  49          'preformatted',
  50          'pullquote',
  51          'quote',
  52          'separator',
  53          'social-links',
  54          'spacer',
  55          'subhead',
  56          'table',
  57          'text-columns',
  58          'verse',
  59          'video',
  60      );
  61  
  62      foreach ( $block_folders as $block_folder ) {
  63          register_block_type_from_metadata(
  64              ABSPATH . WPINC . '/blocks/' . $block_folder
  65          );
  66      }
  67  }
  68  add_action( 'init', 'register_core_block_types_from_metadata' );


Generated : Tue Oct 27 08:20:02 2020 Cross-referenced by PHPXref