apply_filters( 'theme_block_pattern_files', array $files, string $dirpath )
- Since
- 6.8.0
Filters list of block pattern files for a theme.
Compatibility
- WordPress
- since 6.8.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in 4 of the 5 tracked releases, added in 6.8.0.
Parameters
$filesarray- Array of theme files found within
patternsdirectory. $dirpathstring- Path of theme
patternsdirectory being scanned.
Where this hook fires · 1
wp-includes/class-wp-theme.php:1888WP_Theme::get_block_patterns()
Source code
* * @since 6.8.0 * * @param array $files Array of theme files found within `patterns` directory. * @param string $dirpath Path of theme `patterns` directory being scanned. */ $files = apply_filters( 'theme_block_pattern_files', $files, $dirpath ); $dirpath = trailingslashit( $dirpath ); if ( ! $files ) { if ( $can_use_cached ) { $this->set_pattern_cache( $pattern_data );Changelog
Introduced in 6.8.0. Unchanged from 6.8.8 through 7.1.0.
Signature, return type and hooks compared across 4 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.