at path:
ROOT
/
wp-content
/
plugins
/
elementor-pro
/
core
/
app
/
assets
/
js
/
utils.js
run:
R
W
Run
hooks
DIR
2025-12-13 10:20:15
R
W
Run
ui
DIR
2025-12-13 10:20:15
R
W
Run
index.js
85 By
2024-10-19 01:21:21
R
W
Run
Delete
Rename
utils.js
810 By
2024-10-19 01:21:21
R
W
Run
Delete
Rename
error_log
up
📄
utils.js
Save
// Copied from Core. export const arrayToClassName = ( array, action ) => { return array .filter( ( item ) => 'object' === typeof ( item ) ? Object.entries( item )[ 0 ][ 1 ] : item ) .map( ( item ) => { const value = 'object' === typeof ( item ) ? Object.entries( item )[ 0 ][ 0 ] : item; return action ? action( value ) : value; } ) .join( ' ' ); }; export const htmlDecodeTextContent = ( input ) => { const doc = new DOMParser().parseFromString( input, 'text/html' ); return doc.documentElement.textContent; }; export const replaceUtmPlaceholders = ( link = '', utms = {} ) => { if ( ! link || ! utms ) { return link; } Object.keys( utms ).forEach( ( key ) => { const match = new RegExp( `%%${ key }%%`, 'g' ); link = link.replace( match, utms[ key ] ); } ); return link; };