Shortcodes: Make sure wp.shortcode.string() accepts the attrs array keys in any order.

Props yale01, georgestephanis, adamsilverstein, zsusag, mircoraffinetti, SergeyBiryukov.
Fixes #36263.

git-svn-id: https://develop.svn.wordpress.org/trunk@47003 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2019-12-21 18:32:45 +00:00
parent 939fbfa7d3
commit 7abc076e13
2 changed files with 27 additions and 2 deletions
+2 -2
View File
@@ -227,8 +227,8 @@ window.wp = window.wp || {};
this.attrs = wp.shortcode.attrs( attrs );
// Identify a correctly formatted `attrs` object.
} else if ( _.isEqual( _.keys( attrs ), [ 'named', 'numeric' ] ) ) {
this.attrs = attrs;
} else if ( _.difference( _.keys( attrs ), [ 'named', 'numeric' ] ).length === 0 ) {
this.attrs = _.defaults( attrs, this.attrs );
// Handle a flat object of attributes.
} else {