theme_block_pattern_files
Filters list of block pattern files for a theme.
Usage
add_filter( 'theme_block_pattern_files', 'wp_kama_theme_block_pattern_files_filter', 10, 2 ); /** * Function for `theme_block_pattern_files` filter-hook. * * @param array $files Array of theme files found within `patterns` directory. * @param string $dirpath Path of theme `patterns` directory being scanned. * * @return array */ function wp_kama_theme_block_pattern_files_filter( $files, $dirpath ){ // filter... return $files; }
- $files(array)
- Array of theme files found within patterns directory.
- $dirpath(string)
- Path of theme patterns directory being scanned.
Changelog
Since 6.8.0 | Introduced. |
Where the hook is called
theme_block_pattern_files
wp-includes/class-wp-theme.php 1871
$files = apply_filters( 'theme_block_pattern_files', $files, $dirpath );