Fatal error when using custom conditionals
-
Hello,
After updating the plugin my custom conditional function now throws the fatal error: $args not defined. My code looks like this:
/*===========================================
* Custom Event Attribute Conditional
===========================================*/function my_em_has_attribute_event_output_condition($replacement, $condition, $match, $EM_Event){
if( is_object($EM_Event) && preg_match(‘/^has_externallink$/’,$condition, $matches) ){
if( !in_array($args[‘external_link’],$EM_Event->event_attributes) && !empty($EM_Event->event_attributes[‘external_link’]) ){
$replacement = preg_replace(“/\{\/?$condition\}/”, ”, $match);
}else{
$replacement = ”;
}
}// Checks for no_externallink conditional
if(is_object($EM_Event) && preg_match(‘/^no_externallink$/’, $condition, $matches) ){
if( !in_array($args[‘external_link’],$EM_Event->event_attributes) && empty($EM_Event->event_attributes[‘external_link’]) ){
$replacement = preg_replace(“/\{\/?$condition\}/”, ”, $match);
}else{
$replacement = ”;
}
}return $replacement;
}add_action(’em_event_output_condition’, ‘my_em_has_attribute_event_output_condition’, 1, 4);
Any ideas? Thanks!
- The topic ‘Fatal error when using custom conditionals’ is closed to new replies.