WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
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 | } |