jeudi 24 octobre 2019

How to run an if statement against a shortcode attribute value in wordpress

I want to run an if statement on an attribute in my shortcode but for some reason it wont work?

I know that the attribute is being passed through because when I echo it were 'working' currently is I see the value so not sure what's wrong with my if statement?

if ( $atts['type'] == 'Platinum' ) {
?>
    <h2><?php echo 'working'?></h2>
<?php
} else {}

Hope someone can help me out here!

Aucun commentaire:

Enregistrer un commentaire