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; {"id":2091,"date":"2023-09-18T18:06:39","date_gmt":"2023-09-18T18:06:39","guid":{"rendered":"https:\/\/febracistocantins.com.br\/?page_id=2091"},"modified":"2023-09-29T01:59:29","modified_gmt":"2023-09-29T01:59:29","slug":"gratidao","status":"publish","type":"page","link":"https:\/\/febracistocantins.com.br\/vsri\/gratidao\/","title":{"rendered":"Gratid\u00e3o VSRI"},"content":{"rendered":"\t\t