I use this construction to implement my own shortcode:
function column_with_icon($atts, $content = null) {
extract(shortcode_atts(array(
'icon' => 'onebit_03'
), $atts));
return '<div class="column3">
<img class="features-icon" alt="icon" src="' . get_bloginfo("template_url") . '/images/icons/' . $icon . '.png"/>
<div class="feature-content">' . $content . $icon . '</div>';
}
add_shortcode('column-icon', 'column_with_icon');
When I try to add a content like this:
[column-icon icon="onebit_13"]
<h3>What is Lorem ipsum?</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
<a href="#" class="main-theme-link">Learn more</a></div>
[/column-icon]
The default value of ‘icon’ attribute is not overridden and I get it equal ‘onebit_03’, not ‘onebit_13’
What can I do about this?
UPDATE
Here is the code I use to retrieve and present the data:
function skible_load_special_offer_section() {
$content = get_option("prc_speciall_offer_text", true);
if (get_option("prc_show_special_offer_section")) {
echo stripslashes(do_shortcode('<!--Start Special offer (in border) content-->
<div class="border-top"></div>
<div class="border-middle">
<div class="special-offer-area">
<div class="special-offer-image-left">
<img alt="image" src="' . get_bloginfo("template_url") . ' /colors/magic_night/special-offer-image.png"/>
</div>
<div class="special-offer-content-right">' . $content . '</div>
<div class = "clear"></div>
</div>
</div>
<div class = "border-bottom"></div>
<!--End Special offer (in border) content-->'));
}
}
I have no idea what goes wrong at your setup. Clearly shortcode is properly registered, but some specific case something prevents it from being parsed correctly.
This is test code that roughly replicates how shortcode is parsed for execution :
Array output should match following, according to
get_shortcode_regex()
spec:This is what it dumps for me: