Opened 16 months ago
Last modified 3 months ago
#61755 new defect (bug)
Use WPINC constant in script-loader.php
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Script Loader | Keywords: | close |
| Focuses: | Cc: |
Description
https://github.com/WordPress/wordpress-develop/blame/trunk/src/wp-includes/script-loader.php#L135 and various others in this file
These should be changed to use WPINC to keep it consistent
Note: See
TracTickets for help on using
tickets.
It does seem that
WPINCis always defined to bewp-includes. It seems like the convention is to useWPINCfor file paths but not URLs. That leads to patterns like this:I think you're suggesting it should be used for URLs as well:
becomes
Is that what you recommend? Would that provide any benefits other than consistency?
I see that the usage does have some consistency, where the full path is written our for asset URLs. The form that uses concatenation with
WPINCseems to trade the risk of typing/wp-includescorrectly for the risk of concatenatingWPINCincorrectly. There's also the inherent risk that a change has vs. the existing implementation that has seen real world usage.