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

Rename wp_in_development_mode() to wp_is_development_mode() #4850

Conversation

joemcgill
Copy link
Member

This is a follow up to [56223] which replaces the wp_in_ prefix with wp_is_ to be more consistent with other boolean functions in WordPress, like wp_is_maintenance_mode(), wp_is_recovery_mode(), etc.

See #57487.

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


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.

This is a follow up to [56223] which replaces the `wp_in_` prefix with `wp_is_` to be more consistent with other boolean functions in WordPress, like wp_is_maintenance_mode(), wp_is_recovery_mode(), etc.

See #57487.
Copy link
Member

@SergeyBiryukov SergeyBiryukov left a comment

Choose a reason for hiding this comment

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

Good catch, thanks! wp_is_development_mode() would be my preference too.

See comment 6 on #49959 for renaming wp_in_maintenance_mode() to wp_is_maintenance_mode() previously.

@joemcgill joemcgill changed the title Rename wp_in_development_mode() to wp_is_development_mode() Rename wp_in_development_mode() to wp_is_development_mode() and check for 'any' Jul 14, 2023
@joemcgill
Copy link
Member Author

I've added a new commit to this PR to address @azaozz's comment in https://core.trac.wordpress.org/ticket/57487#comment:55 about the need to support checking for any valid development mode.

@joemcgill joemcgill requested a review from azaozz July 14, 2023 22:18
@joemcgill joemcgill marked this pull request as ready for review July 14, 2023 22:18
Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

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

A couple of minor notes.

I'm not too fussed about the default value but additional unit tests would be dandy.

src/wp-includes/load.php Outdated Show resolved Hide resolved
src/wp-includes/load.php Outdated Show resolved Hide resolved
Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

Naming LGTM, but adding a default value is not a good idea here IMO.

src/wp-includes/load.php Outdated Show resolved Hide resolved
@joemcgill joemcgill changed the title Rename wp_in_development_mode() to wp_is_development_mode() and check for 'any' Rename wp_in_development_mode() to wp_is_development_mode() Jul 17, 2023
@joemcgill
Copy link
Member Author

I've committed the name change in https://core.trac.wordpress.org/changeset/56249. The conversation about adding a default value can continue on this PR.

@joemcgill joemcgill closed this Jul 17, 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
4 participants