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

Replace 'else if' with 'elseif' #4293

Closed
wants to merge 2 commits into from

Conversation

akramulhasan
Copy link

The WordPress coding standards recommend using 'elseif' instead of 'else if' for conditionals to ensure consistency in the code syntax. This is because 'else if' is not compatible with the colon syntax for if|elseif blocks.
However, in the WordPress core file wp-includes/atomlib.php, on lines 251, 263, 265, and 305, 'else if' is used for conditionals. To ensure consistency with the WordPress coding standards and improve the readability and maintainability of the code, I propose replacing all instances of 'else if' with 'elseif' on these lines.
This change will ensure that the code follows the recommended syntax and is consistent with the rest of the WordPress core codebase.
I will create a pull request to the WordPress core repository with this change.

Trac ticket: https://core.trac.wordpress.org/ticket/58063


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

In the WordPress core file wp-includes/atomlib.php, on lines 251, 263, 265, and 305, 'else if' is used for conditionals. I propose replacing all instances of 'else if' with 'elseif' on these lines.
Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @akramulhasan, Can you search similar instance in whole folder and correct it so we don't get similar ticket for other files?

In the WordPress core files, on several files 'else if' is found for conditionals. I propose replacing all instances of 'else if' with 'elseif'.
@akramulhasan
Copy link
Author

Thanks @akramulhasan, Can you search similar instance in whole folder and correct it so we don't get similar ticket for other files?

Hi, @mukeshpanchal27
Done!

@jrfnl
Copy link
Member

jrfnl commented Apr 7, 2023

These are files from external dependencies which should not be changed.

@jrfnl jrfnl closed this Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants