AB
Size: a a a
AB
AB
AB
AB
EB
Z
IV
<?php
// Define component defaults in the component itself.
$defaults = [
'classes' => [
'btn',
],
'id' => false,
'label' => '',
];
// Merge with passed $props.
$merged_props = wp_parse_args( $props, $defaults );
?>
<!-- Render the compnent html -->
<button
class="<?php echo implode( ' ', $props['classes'] ); ?>"
<?php echo $props['id'] ? "id=\"{$props['id']}\"" : ''; ?>
>
<?php echo $props['label']; ?>
</button>
AB
<?php
// Define component defaults in the component itself.
$defaults = [
'classes' => [
'btn',
],
'id' => false,
'label' => '',
];
// Merge with passed $props.
$merged_props = wp_parse_args( $props, $defaults );
?>
<!-- Render the compnent html -->
<button
class="<?php echo implode( ' ', $props['classes'] ); ?>"
<?php echo $props['id'] ? "id=\"{$props['id']}\"" : ''; ?>
>
<?php echo $props['label']; ?>
</button>
AB
IV
PB
<?php
// Define component defaults in the component itself.
$defaults = [
'classes' => [
'btn',
],
'id' => false,
'label' => '',
];
// Merge with passed $props.
$merged_props = wp_parse_args( $props, $defaults );
?>
<!-- Render the compnent html -->
<button
class="<?php echo implode( ' ', $props['classes'] ); ?>"
<?php echo $props['id'] ? "id=\"{$props['id']}\"" : ''; ?>
>
<?php echo $props['label']; ?>
</button>
AB
IV
<?php
// Calling component from template
get_component( 'button', [
'classes' => [
'btn-primary',
],
'label' => 'Submit my fucking form now',
] );
IV
IV
AB