# cartflows/3.3.0/modules/gutenberg/src/controls/getAttributeFallback.js

CartFlows – Funnel Builder &amp; Checkout Plugin for WooCommerce, version 3.3.0. 17 lines.

- Page: https://pluginprobe.com/plugins/cartflows/3.3.0/code/modules/gutenberg/src/controls/getAttributeFallback.js
- Raw: https://pluginprobe.com/plugins/cartflows/3.3.0/raw/modules/gutenberg/src/controls/getAttributeFallback.js
- Modified: 2022-11-07T12:36:12+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/cartflows/3.3.0/code/modules/gutenberg/src/controls/getAttributeFallback.js#L10-L20`.

```javascript
import { blocksAttributes } from '@Attributes/getBlocksDefaultAttributes';

// Parameters for these methods:
// currentValue - The variable/attribute that is altered by settings.
// key          - The key of the default attribute for that setting.
// blockName    - The name of the block.

const getAttributeFallback = ( currentValue, key, blockName ) =>
	currentValue ? currentValue : blocksAttributes[ blockName ][ key ].default;

export const getFallbackNumber = ( currentValue, key, blockName ) =>
	isNaN( currentValue )
		? blocksAttributes[ blockName ][ key ].default
		: currentValue;

export default getAttributeFallback;

```
