WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Events Manager] 5.1.3 EM_Location::Output bug (3 posts)

  1. clivewalker
    Member
    Posted 2 years ago #

    We think there is a bug with EM_Location::Output

    EM_Location::output() mixes it up between $location_string and $format, but finally outputs $location_string. The filter below is called on $format, and changes are never output.

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

    Forum topic here describes this
    http://wordpress.org/support/topic/plugin-events-manager-511-breaks-conditional-placeholders?replies=24

    User webaware has posted a fix for this in the above forum topic link.

  2. clivewalker
    Member
    Posted 2 years ago #

    I've amended the topic title because I'm using EM 5.1.3 not 5.1.1

  3. webaware
    Member
    Posted 2 years ago #

    Well, not a "fix", just a hack to show the problem.

    @544 /wp-content/plugins/events-manager/classes/em-location.php insert:
    $location_string = $format;

    It then "works" but obviously is subverting what the rest of the function is doing with $location_string vs $format.

Topic Closed

This topic has been closed to new replies.

About this Topic