!empty( $start ) ? $start : 0, 'end' => !empty( $end ) ? $end : 100, 'decimalPlaces' => !empty( $decimal_places ) ? $decimal_places : 0, 'duration' => !empty( $duration ) ? $duration : 3, 'useEasing' => !empty( $smooth_animation ) ? true : false, 'useGrouping' => !empty( $display_separator ) ? true : false, 'separator' => $thousands_separator, 'decimal' => $decimal_separator, 'easingFn' => $animation_effect, 'numerals' => $numerals ]; $this->add_render_attribute( 'widget', [ 'class' => [ 'stratum-counter' ] ] ); $this->add_render_attribute( 'wrapper', [ 'class' => 'stratum-counter__wrapper', 'data-options' => json_encode( $options ) ] ); //-----------/PHP----------- } //-----------JS (BACKBONE)----------- else if ( $type == 'js' ) { ?> <# const { start, end, decimal_places, duration, smooth_animation, display_separator, thousands_separator, decimal_separator, animation_effect, numerals } = settings; const options = { start: start != '' ? start: 0, end: end != '' ? end: 0, decimalPlaces: decimal_places != '' ? decimal_places : 0, duration: duration != '' ? duration : 3, useEasing: smooth_animation != '' ? true : false, useGrouping: display_separator != '' ? true : false, separator: thousands_separator, decimal: decimal_separator, easingFn: animation_effect, numerals: numerals }; view.addRenderAttribute( 'widget', { 'class': [ 'stratum-counter' ] } ); view.addRenderAttribute( 'wrapper', { 'class': [ 'stratum-counter__wrapper' ], 'data-options': JSON.stringify( options ) } ); #> get_render_attribute_string( 'widget' ) : "{{{ view.getRenderAttributeString( 'widget' ) }}}"; $widget_wrapper = $type == 'php' ? $this->get_render_attribute_string( 'wrapper' ) : "{{{ view.getRenderAttributeString( 'wrapper' ) }}}"; ?>
>
>

<# if ( settings.prefix != '' ) { #>

<# } #>

<# if ( settings.suffix != '' ) { #>

<# } #>