Custom shortcode not working after upgrade
-
Hi, thanks again for a wonderful plugin.
{is_newpost}*NEW*{/is_newpost} is not working following upgrade with the following code, can anyone assist?
add_filter( 'em_events_build_sql_conditions', 'my_em_scope_conditions',1,2); function my_em_scope_conditions($conditions, $args){ if( !empty($args['scope']) && $args['scope']=='newposts' ){ $start_date = date('Y-m-d H:i:s',strtotime("-2 days", current_time('timestamp'))); $conditions['scope'] = " ( event_date_modified >= '$start_date') OR ( event_date_created >= '$start_date')"; } return $conditions; } add_filter( 'em_get_scopes','my_em_scopes',1,1); function my_em_scopes($scopes){ $my_scopes = array( 'newposts' => 'New Posts' ); return $scopes + $my_scopes; } 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('/^is_newpost$/',$condition, $matches) ){ if( strtotime($EM_Event->event_date_created) >= strtotime("-3 days", current_time('timestamp'))){ $replacement = preg_replace("/\{\/?$condition\}/", '', $match); }else{ $replacement = ''; } } return $replacement; }The page I need help with: [log in to see the link]
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
The topic ‘Custom shortcode not working after upgrade’ is closed to new replies.