[HPOS] Add properties and methods for detecting order admin screens more easily #38417
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this Pull Request:
post_typeproperty ofWP_Screenwhen on an order-related admin screen with custom order tables set to authoritative, for better consistency between the posts UI and the COT UI.is_order_screenmethod to the OrdersPageControllerclass, which can be used to check if the current admin screen is an order-related screen, regardless of which tables are authoritative.OrderUtilto check for specific order-related admin screens.Fixes #37484
How to test the changes in this Pull Request:
This PR introduces new utility functions, but doesn't use them anywhere in the existing codebase. So one good way to test the new functions is with a simple mu-plugin. Add the following snippet to a new file in the
wp-content/mu-pluginsdirectory:This will add a notice to the top of many pages in WP Admin that shows the results of running each of the new utility functions (notably, block editor screens will not show this notice).