button
Documentation and examples of the button component. Can be used for both links and actual buttons.
Arguments
- label
- The button text
- href
- The link that will be applied
- post
- Will set label and href defaults to post title and url
- variation
- Button style. Supports primary (default), secondary, tertiary, plain.
Simple button
echo fuse( 'button', array( 'href' => 'https://google.com', 'label' => 'Simple button' ) );
Secondary variation
echo fuse( 'button', array( 'href' => 'https://google.com', 'label' => 'Secondary', 'variation' => 'secondary' ) );
Tertiary variation
echo fuse( 'button', array( 'href' => 'https://google.com', 'label' => 'Tertiary', 'variation' => 'tertiary' ) );
Plain variation
echo fuse( 'button', array( 'href' => 'https://google.com', 'label' => 'Plain', 'variation' => 'plain' ) );
Button (not anchor)
echo fuse( 'button', array( 'onclick' => 'alert("Hello")', 'label' => 'Hi there!', ) );
Button (ACF)
Label is not needed in this case since it will retrieve it from the get_field. This is just for highlighting the button.
echo fuse( 'button', array( 'label' => 'ACF Button', 'acf_link' => get_field('acf_link') ) );