Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: twentytwentytwo_block_patterns

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
115      );
116
117      /**
118       * Filters the theme block patterns.
119       *
120       * @since Twenty Twenty-Two 1.0
121       *
122       * @param array $block_patterns List of block patterns by name.
123       */
124      $block_patterns = apply_filters( 'twentytwentytwo_block_patterns', $block_patterns );
125
126      foreach ( $block_patterns as $block_pattern ) {
127           $pattern_file = get_theme_file_path( '/inc/patterns/' . $block_pattern . '.php' );
128
129           register_block_pattern(
130                'twentytwentytwo/' . $block_pattern,
131                require $pattern_file
132           );
133      }