[wp-trac] [WordPress Trac] #59249: shortcode_parse_atts() result for no attributes does not match the documentation
WordPress Trac
noreply at wordpress.org
Mon Feb 12 16:07:01 UTC 2024
#59249: shortcode_parse_atts() result for no attributes does not match the
documentation
-------------------------------------------------+-------------------------
Reporter: SergeyBiryukov | Owner: swissspidy
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 6.5
Component: Shortcodes | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch has-testing-info has- | Focuses:
unit-tests commit |
-------------------------------------------------+-------------------------
Changes (by swissspidy):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"57597" 57597]:
{{{
#!CommitTicketReference repository="" revision="57597"
Shortcodes: Always return an array in `shortcode_parse_atts()`.
Previously, `shortcode_parse_atts()` would return the input (an empty
string) if a shortcode had no attributes, even though the documentation
said otherwise.
Always returning an (empty) array reduces confusion and improves developer
experience as the return value does not have to be manually checked in the
shortcode itself.
Props: nicolefurlan, swissspidy, johnbillion, bedas.
Fixes #59249.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59249#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list