import { blocksAttributes } from '@Attributes/getBlocksDefaultAttributes'; import { applyFilters } from '@wordpress/hooks'; // 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 ) => { const allBlocksAttributes = applyFilters( 'uagb.blocksAttributes', blocksAttributes ); return currentValue ? currentValue : allBlocksAttributes[ blockName ][ key ].default; } export const getFallbackNumber = ( currentValue, key, blockName ) => { const allBlocksAttributes = applyFilters( 'uagb.blocksAttributes', blocksAttributes ); return isNaN( currentValue ) ? allBlocksAttributes[ blockName ][ key ].default : currentValue; } export default getAttributeFallback; {"version":"1.0","provider_name":"Febracis Palmas","provider_url":"https:\/\/febracistocantins.com.br","author_name":"admin","author_url":"https:\/\/febracistocantins.com.br\/author\/admin\/","title":"Intelig\u00eancia Financeira","type":"rich","width":600,"height":338,"html":"
Intelig\u00eancia Financeira<\/a><\/blockquote>