Opened 11 years ago
Closed 11 years ago
#31126 closed enhancement (fixed)
wp_register_script|style() should return boolean success/failure value
| Reported by: | katzwebdesign | Owned by: | johnbillion |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.3 |
| Component: | Script Loader | Version: | 4.2 |
| Severity: | minor | Keywords: | has-patch commit |
| Cc: | Focuses: |
Description
wp_register_script() currently returns no value. When registering a script fails, it fails silently.
The wp_register_script() function is essentially a wrapper for $wp_scripts->add(), so wp_register_script() should return the same boolean "True on success, false on failure." value.
Attachments (6)
Change History (19)
#1
@
11 years ago
- Keywords has-patch dev-feedback needs-unit-tests needs-codex added
- Severity normal → minor
- Version → trunk
@
11 years ago
Have the wp_register_script() and wp_register_style() functions return boolean on success/fail
#5
@
11 years ago
- Keywords 4.3-early added; needs-codex removed
- Milestone Awaiting Review → Future Release
31126.2.diff combines the changes with the tests, adds changelog entries for the added return values. Let's pick this up in 4.3-early.
#8
@
11 years ago
- Keywords commit added; dev-feedback removed
31126.3.diff updates the changelog entries to 4.3.0, and simplifies/self-documents the return values in both contexts. Looks good to me.
#9
@
11 years ago
- Summary wp_register_script() should return boolean success/failure value → wp_register_script|style() should return boolean success/failure value
#10
follow-up:
↓ 11
@
11 years ago
Would $registered or $is_registered be more descriptive than $add_result? That could also mean adding up results or something.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Have the wp_register_script() function return boolean passed by $wp_scripts->add()