Let's say I have created a button component I want to include into my project with Sage 10's @include
function, how do I add fallbacks to the variables, in case I or another user forget to add a value?
My button*:
<button class="<?= esc_attr($button_class); ?>">
<?= esc_html($button_label); ?>
</button>
My include
@include('partials.button', [
'button_class' => 'btn btn-primary',
'button_label' => 'label',
])
How can I add fallbacks, so button isn't empty if I don't add button_label
?
*Code is simplified for this example