Support » Plugin: Events Manager - Calendar, Bookings, Tickets, and more! » Conditional Placeholder – Category Images

  • Resolved mtharani

    (@mtharani)


    I have had some previous success in obtaining code for conditional placeholders for some location attributes. I’ve included the code below for reference. What I need to do now is either rewrite, or obtain newly, code to do exactly the same thing for category images, or #_CATEGORYIMAGE. I have no idea where to start. Any help would appreciated.

    function filterLocationOutputCondition($replacement, $condition, $match, $EM_Location){
        if (is_object($EM_Location)) {
    
            switch ($condition) {
    
                // #_LATT{Website}
                case 'has_latt_website':
                    if (is_array($EM_Location->location_attributes) && !empty($EM_Location->location_attributes['Website']))
                        $replacement = preg_replace('/\{\/?has_latt_website\}/', '', $match);
                    else
                        $replacement = '';
                    break;
            }
    
        }
    
        return $replacement;
    }
    
    add_filter('em_location_output_condition', 'filterLocationOutputCondition', 10, 4);

    http://wordpress.org/extend/plugins/events-manager/

Viewing 1 replies (of 1 total)
  • should be the same just replace em_location_output_condition with em_category_output_condition and $EM_Location with $EM_Category then check for $EM_Category->get_image_url()

Viewing 1 replies (of 1 total)
  • The topic ‘Conditional Placeholder – Category Images’ is closed to new replies.