• Resolved jester48

    (@jester48)


    I have several custom filelds

    #_ATT{GAME1 START TIME}
    #_ATT{GAME1 END TIME}

    #_ATT{GAME12 START TIME}
    #_ATT{GAME12 END TIME}

    not everyone will have a GAME8+

    how do i make it so that a code block in the widget/page listing will only show if #_ATT{GAME8 START TIME} does not equal ”, i looked on the plug-in website and i would prefer not to create a function for every custom input/value

    TIA

Viewing 3 replies - 1 through 3 (of 3 total)
  • you’d have to create a custom function for this sort of thing, no way around that I don’t think.

    Thread Starter jester48

    (@jester48)

    been looking in to that

    got this from the site


    add_action('em_event_output_condition', 'my_em_styles_event_output_condition', 1, 4);

    function my_em_styles_event_output_condition($replacement, $condition, $match, $EM_Event){

    if( is_object($EM_Event) && preg_match('/^has_style_(.+)$/',$condition, $matches) && is_array( $EM_Event->styles ) ){

    if( in_array($matches[1],$EM_Event->styles) ){

    $replacement = preg_replace("/\{\/?$condition\}/", '', $match);

    }else{

    $replacement = '';

    }

    }

    return $replacement;

    }

    problem is I am not that great with php, is this even the right function to be looking at?

    thanks for the fast response.

    yes, that’s the right way to go

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Events Manager] Conditional Display of Custom Attributes’ is closed to new replies.