Opened 3 years ago
Closed 3 years ago
#58655 closed defect (bug) (duplicate)
The function _register_theme_block_patterns check to see if directory exist multiple times
| Reported by: | spacedmonkey | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Editor | Version: | 6.2 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | performance |
Description
In the function _register_theme_block_patterns check to see if a directory exists three files.
$dirpath = $theme->get_stylesheet_directory() . '/patterns/'; if ( ! is_dir( $dirpath ) || ! is_readable( $dirpath ) ) { continue; } if ( file_exists( $dirpath ) ) { $files = glob( $dirpath . '*.php' );
This calls is_dir, is_readable and file_exists basically the same thing. This should be avoided.
Change History (1)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Duplicate of #58656.