mercredi 23 octobre 2019

How to put a shortcode attribute in an if statement in PHP

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?

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

Hope someone can help me out here!

Aucun commentaire:

Enregistrer un commentaire