Opened 2 years ago
Last modified 14 months ago
#61755 new defect (bug)
Use WPINC constant in script-loader.php
| Reported by: | kkmuffme | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Script Loader | Version: | |
| Severity: | normal | Keywords: | close |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.