WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Conditional Placeholder - Category Images (2 posts)

  1. mtharani
    Member
    Posted 1 year ago #

    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/

  2. agelonwl
    Member
    Posted 1 year ago #

    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()

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic