Opened 10 years ago
Closed 10 years ago
#31126 closed enhancement (fixed)
wp_register_script|style() should return boolean success/failure value
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | minor | Version: | 4.2 |
Component: | Script Loader | Keywords: | has-patch commit |
Focuses: | Cc: |
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
@
10 years ago
- Keywords has-patch dev-feedback needs-unit-tests needs-codex added
- Severity changed from normal to minor
- Version set to trunk
@
10 years ago
Have the wp_register_script() and wp_register_style() functions return boolean on success/fail
#5
@
10 years ago
- Keywords 4.3-early added; needs-codex removed
- Milestone changed from Awaiting Review to 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
@
10 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
@
10 years ago
- Summary changed from wp_register_script() should return boolean success/failure value to wp_register_script|style() should return boolean success/failure value
#10
follow-up:
↓ 11
@
10 years ago
Would $registered
or $is_registered
be more descriptive than $add_result
? That could also mean adding up results or something.
#11
in reply to:
↑ 10
@
10 years ago
Replying to obenland:
Would
$registered
or$is_registered
be more descriptive than$add_result
? That could also mean adding up results or something.
Changed to $registered
in 31126.4.diff.
Have the wp_register_script() function return boolean passed by $wp_scripts->add()