PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
← All changes | blocks/table/src/common/functions.js +6 -6 2.2 → 3.4 View file →
@@ -9,17 +9,17 @@
9 9
10 10 /**
11 11 * Converts a set of named and numeric Shortcode attributes to a string.
12 12 *
13 - * This function is similar to @wordpress/shortcode's `string()` function,
13 + * This function is similar to `@wordpress/shortcode`'s `string()` function,
14 14 * but only returns the attributes string and not a full Shortcode.
15 15 *
16 16 * @param {Object} shortcodeAttrs The named and numeric Shortcode attributes.
17 17 * @return {string} The attributes as a key=value string.
18 18 */
19 -export const shortcode_attrs_to_string = ( shortcodeAttrs ) => {
19 +export const shortcodeAttrsToString = ( shortcodeAttrs ) => {
20 20 // Convert named attributes.
21 - let shortcode_attrs_string = Object.entries( shortcodeAttrs.named ).map( ( [ attribute, value ] ) => {
21 + let shortcodeAttrsString = Object.entries( shortcodeAttrs.named ).map( ( [ attribute, value ] ) => {
22 22 let enclose = ''; // Don't enclose values by default.
23 23
24 24 // Remove curly quotation marks around a value.
25 25 value = value.replace( /“([^”]*)”/g, '$1' );
@@ -39,12 +39,12 @@
39 39
40 40 // Convert numeric attributes.
41 41 shortcodeAttrs.numeric.forEach( ( value ) => {
42 42 if ( /\s/.test( value ) ) {
43 - shortcode_attrs_string += ' "' + value + '"';
43 + shortcodeAttrsString += ' "' + value + '"';
44 44 } else {
45 - shortcode_attrs_string += ' ' + value;
45 + shortcodeAttrsString += ' ' + value;
46 46 }
47 47 } );
48 48
49 - return shortcode_attrs_string;
49 + return shortcodeAttrsString;
50 50 };