This is on Vanilla installation. I've made a shortcode:-
/**
* Creates a shortcode for shortcode_use_here
* @author Omar Tariq <[email protected]>
*/
function callback_banana_abc( $args ){
/* Don't echo! Always return */
return 'yay!';
}
add_shortcode( 'banana_abc', 'callback_banana_abc' );
And I've made a template that looks like this:-
<?php
/*
* Template Name: Test Template
* Description: Hello world.
*/
$str = '<a href="#" title="[banana_abc]" data-abc="[banana_abc]">[banana_abc]</a>';
echo do_shortcode($str);
The output is:-
<a href="#" title="yay!" data-abc="[banana_abc]">yay!</a>
This is only for data-* attributes. It works fine when used in title
attribute.
a herf
is not valid HTML.