Skip to content

Remove multiple directory validation check from function _register_theme_block_patterns#6

Draft
nirav7707 wants to merge 3 commits intotrunkfrom
refactor/58656-multiple-file-exist-check
Draft

Remove multiple directory validation check from function _register_theme_block_patterns#6
nirav7707 wants to merge 3 commits intotrunkfrom
refactor/58656-multiple-file-exist-check

Conversation

@nirav7707
Copy link
Owner

Trac Ticket -> https://core.trac.wordpress.org/ticket/58656


In the pull request (PR), the changes were made to remove the is_dir and is_readable checks. These checks were originally used to verify the availability of a directory. To streamline the code and avoid multiple checks, the file_exists function was used to validate the directory's existence.

To implement this, an if condition was added with the negation of the file_exists check. If the condition is met, the continue statement is executed, skipping the rest of the code. However, if the directory is valid, the remaining code is executed as usual.

nirav7707 and others added 3 commits June 28, 2023 17:11
is_dir and is_readable function are used to check the dir exist or not
and file_exists also check for the existence to avoid multiple check
for same purpose add the non file exists check for continue statement
and else for the operation.
Co-authored-by: Jonny Harris <spacedmonkey@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant