diff --git a/generators/app/templates/gulp/templatesFunctions.js b/generators/app/templates/gulp/templatesFunctions.js index 74d7dde5..2263a5ca 100644 --- a/generators/app/templates/gulp/templatesFunctions.js +++ b/generators/app/templates/gulp/templatesFunctions.js @@ -40,8 +40,14 @@ module.exports = function templateFunctions(data = {}) { } const classes = [name]; let el; - for (let i = 0; i < args.length; i += 1) { - el = args[i]; + let modifiers; + if(args[0] instanceof Array) { + modifiers = args[0]; + } else { + modifiers = args; + } + for (let i = 0; i < modifiers.length; i += 1) { + el = modifiers[i]; if (el && typeof el === 'string') { classes.push(`${name}--${el}`); } diff --git a/generators/wp/templates/chisel-starter-theme/Chisel/Extensions/ChiselTwig.php b/generators/wp/templates/chisel-starter-theme/Chisel/Extensions/ChiselTwig.php index e43ec7a5..659cfc2a 100644 --- a/generators/wp/templates/chisel-starter-theme/Chisel/Extensions/ChiselTwig.php +++ b/generators/wp/templates/chisel-starter-theme/Chisel/Extensions/ChiselTwig.php @@ -145,7 +145,9 @@ public function className( $name = '', $modifiers = null ) { if ( ! is_string( $name ) || empty( $name ) ) { return ''; } - $modifiers = array_slice( func_get_args(), 1 ); + if ( ! is_array( $modifiers ) ) { + $modifiers = array_slice( func_get_args(), 1 ); + } $classes = array( $name ); foreach ( $modifiers as $modifier ) { if ( is_string( $modifier ) && ! empty( $modifier ) ) {