Support

Home Forums Event Espresso Premium Conditional statement for event meta

Conditional statement for event meta

Posted: October 30, 2013 at 6:31 pm

Viewing 2 reply threads


Angela Haddon

    October 30, 2013 at 6:31 pm

    Hi, I’m just trying to set up a simple conditional PHP statement for an event meta, so that it only displays when a meta value actually exists (ie. using the usual meta display shortcode). Perhaps I shouldn’t be working so late, but I’m just struggling to come up with a solution as the EE meta key/value pairs appear a little different to the normal WP ones. I’d appreciate any help with this, or at least a point in the right direction. Thanks :D


    Dean

    • Support Staff

    October 31, 2013 at 2:56 am

    Hey,

    Something like this

    <?php
    $mymeta = unserialize($event->event_meta);
    //var_dump($mymeta);
    if(isset($mymeta['name_of_meta_key_goes_here'])) {echo "This meta key is set";}
    ?>


    Angela Haddon

      November 2, 2013 at 3:23 pm

      Great – thanks Dean, appreciate the help!

      Viewing 2 reply threads

      The support post ‘Conditional statement for event meta’ is closed to new replies.

      Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

      Event Espresso - Staging Server