> For the complete documentation index, see [llms.txt](https://whoisandywhite.gitbook.io/porterwp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whoisandywhite.gitbook.io/porterwp/developer-api/hooks/porter_block_patterns_path.md). Agents can also search and read this documentation through its [MCP server](https://whoisandywhite.gitbook.io/porterwp/~gitbook/mcp).

# porter\_block\_patterns\_path

Filters the directory containing a configured pattern's PHP content file.

```php
add_filter( 'porter_block_patterns_path', function ( string $directory, string $pattern_name ) : string {
    return get_stylesheet_directory() . '/patterns/source';
}, 10, 2 );
```

The default is `porter/inc/block/patterns`. Porter appends `/{sanitized-pattern-name}.php` after the filter runs.
