Shortcode not reading passed up values.
-
Hello all,
I have been trying to create a shortcode, but it seems that the shortcode is always using the default values. It does not render the values that were passed up.
Ex.
functions.php has the following code:
function portfolio_shortcode( $atts ) {
$atts = shortcode_atts(
array(
‘actionText’ => ‘Portfolio’,
),
$atts, ‘portfolioAction’
);$actionText = esc_html($atts[‘actionText’]);
return $actionText ;
}
add_shortcode( ‘portfolioAction’, ‘portfolio_shortcode’ );Now when I try to enter the following code in a post, it will always render “Portfolio” (the default value), instead of the past in value:
[portfolioAction actionText=”Some Text”]
Any help as to why this does not render “Some Text”? Thank You
- The topic ‘Shortcode not reading passed up values.’ is closed to new replies.