Last inserted events – Order by ‘event_id’
-
Hi.
I would like to insert a widget with the last inserted events. The idea is to select only future events in the next X monthes and order them by event_id
I look the documentation https://wp-events-plugin.com/tutorials/create-your-own-event-scope/ and I add some new scope, but with orderby something is wrong… Anyone can help me?
add_filter( 'em_events_build_sql_conditions', 'my_em_orderby_options',1,2); function my_em_orderby_options($conditions, $args){ if( !empty($args['orderby']) && $args['orderby']=='ultimi-inseriti' ){ $conditions['orderby'] = " event_id " ; } return $conditions; } add_filter( 'em_orderby_options','my_em_orderby_options',1,1); function my_em_orderby_options($order){ $my_order = array( 'ultimi-inseriti' => 'Ultimi inserimenti' ); return $order + $my_order; }
Thanks in advance
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Last inserted events – Order by ‘event_id’’ is closed to new replies.