Created
September 18, 2019 08:23
-
-
Save michaeldeboeve/5bdc98f30c2edd8b6c6d5c059a495109 to your computer and use it in GitHub Desktop.
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
<?php | |
function my_shortcode_attr( $atts, $content = null) { | |
$a = shortcode_atts( array( | |
'url' => '#', | |
'class' => '' | |
), $atts ); | |
return '<a class="' . $a["class"] . '" href="' . $a["url"] . '">' . $content . '</a>'; | |
} | |
add_shortcode( 'myshortcode', 'my_shortcode_attr' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment