Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove multiple directory validation check from function _register_theme_block_patterns #4752

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

nirav7707
Copy link

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 is_readable function was used to validate the directory's existence and readability.

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

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>
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @nirav7707.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

Core Committers: Use this line as a base for the props when committing in SVN:

Props spacedmonkey.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants