Created
July 13, 2023 02:06
-
-
Save chekle/64ef6bc6910ee44cac43fc3ae26781a5 to your computer and use it in GitHub Desktop.
Custom Shortcode Button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Custom shortcode button function */ | |
add_shortcode( 'action-button', 'action_button_shortcode' ); | |
function action_button_shortcode( $atts ) { | |
extract( shortcode_atts( | |
array( | |
'title' => 'Title', | |
'url' => '' | |
), | |
$atts | |
)); | |
return '<a href="' . $url . '" class="primary-btn">' . $title . '</a>'; | |
} | |
/* Shortcode */ | |
[action-button title="Make a booking" url="https://yourwebsite.co.nz/book-now/"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment