corvée(dépendances) ajoute Carbon Fields

This commit is contained in:
gcch 2024-08-09 18:45:01 +02:00
commit 62368587e5
459 changed files with 72750 additions and 26 deletions

View file

@ -0,0 +1,15 @@
/**
* Removes the prefix used to compact the input of Carbon Fields.
*
* @param {string} str
* @return {string}
*/
export default function stripCompactInputPrefix( str ) {
const { compactInput, compactInputKey } = window.cf.config;
if ( ! compactInput || str.indexOf( compactInputKey ) !== 0 ) {
return str;
}
return str.replace( new RegExp( `^${ compactInputKey }\\[(.+?)\\]` ), '$1' );
}