I have made some shortcode plugins according to my need. But this time I am getting a strange problem. My attributes in the shortcode are not getting the values written in the shortcode while executing them, instead I am just getting the default set values only. Please Help me.
add_shortcode('wi_form' , 'wi_form_func');
function wi_form_func($input) {
extract(shortcode_atts( array(
'productName' => 'Java',
'productPrice' => 1000
), $input));
return $productName . esc_attr($productPrice);
}
Try not to use capital letters in the shortcode attributes, use for example
where:
or this:
if you don’t want to use
extract
:Update:
The shortcode attributes go through
strtolower()
in theshortcode_parse_atts()
function that retrieves them from the shortcode tag (see here).