Opened 2 years ago
Last modified 2 years ago
#56382 new enhancement
Allow filtering excluded directories during theme export via `wp_is_theme_directory_ignored`
Reported by: | Mat Lipe | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 6.0 |
Component: | Themes | Keywords: | has-patch |
Focuses: | Cc: |
Description
The wp_is_theme_directory_ignored
function excludes the majority of common vendor or VCS files by default during theme export via the Site Editor.
There are themes which may need to exclude additional directories on a case by case basis. A few examples include:
- Source files for JS tools like Webpack.
- Unit test files.
- .yarn files for Yarn projects with PNP support.
By offering a filter to theme developers we allow developers to filter as needed without needing to maintain a list of exclusions which covers all cases.
Change History (1)
This ticket was mentioned in PR #3094 on WordPress/wordpress-develop by lipemat.
2 years ago
#1
- Keywords has-patch added
Note: See
TracTickets for help on using
tickets.
The wp_is_theme_directory_ignored function excludes the majority of common vendor or VCS files by default during theme export via the Site Editor.
There are themes which may need to exclude additional directories on a case by case basis. A few examples include:
By offering a filter to theme developers we allow developers to filter as needed without needing to maintain a list of exclusions which covers all cases.
### Testing
Assuming running the TwentyTwentyTwo theme.
{{{php
add_filter( 'ignored_theme_directory', function( $dirs ) {
} );
}}}
https://core.trac.wordpress.org/ticket/56382