> 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_wp_inc_filepath.md). Agents can also search and read this documentation through its [MCP server](https://whoisandywhite.gitbook.io/porterwp/~gitbook/mcp).

# porter\_wp\_inc\_filepath

Filters the root directory recursively scanned for theme PHP includes.

```php
add_filter( 'porter_wp_inc_filepath', function ( string $directory ) : string {
    return get_stylesheet_directory() . '/src/php';
} );
```

The default is `porter/inc`. For safety, Porter resolves the returned root and loads only readable `.php` files contained within it.

Register this filter in the theme's `functions.php`, an MU plugin, or a plugin that loads before Porter's `init` priority 3 scan. A callback inside `porter/inc/` is too late to change the scan that loads that directory.
