so I have a question regarding custom shortcodes! I created a shortcode for a href as the following:
function makeUrl( $atts , $content = null ) {
extract(shortcode_atts(
array(
'href' => '#',
), $atts ));
return '<a href="'.$href.'">'.$content.'</a>';
}
add_shortcode('url', 'makeUrl');
So basic usage is at [url href="http://www.google.com"]Google[/url] however the problem is when it comes to formatting, when I checked the generated code is enclosed in pre and code blocks like the following:
<pre class="language-php">
<code class="language-php">
<a href="http://www.google.com">Google</a>
</code>
</pre>
What am I doing wrong? Thanks.