Title: Current Month Scope
Last modified: February 26, 2018

---

# Current Month Scope

 *  Resolved [lehamill](https://wordpress.org/support/users/lehamill/)
 * (@lehamill)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/current-month-scope/)
 * I manage a site for the local Submarine Veterans and use Event Manager to list
   submarines that were lost during the current month. Some time ago I found created
   a “Current Month” scope to list all the boats lost during the month even after
   the date has passed. So that all boats lost during that month would be displayed
   all month long. The scope is not working now and to be honest I don’t know when
   it stopped. Below is the code I have that used to work.
 * Please help.
 * /* Create current month scope for event manager */
    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’]==’currentmonth’ ){ $start_date =
   date(‘Y-m’,current_time(‘timestamp’)).’-01′; $end_date = date(‘Y-m’,current_time(‘
   timestamp’)).’-30′; $conditions[‘scope’] = ” (event_start_date BETWEEN CAST(‘
   $start_date’ AS DATE) AND CAST(‘$end_date’ AS DATE)) OR (event_end_date BETWEEN
   CAST(‘$end_date’ AS DATE) AND CAST(‘$start_date’ AS DATE))”; } return $conditions;}
 * add_filter( ’em_get_scopes’,’my_em_scopes’,1,1);
    function my_em_scopes($scopes){
   $my_scopes = array( ‘currentmonth’ => ‘Current Month Not Working’ ); return $
   scopes + $my_scopes; }
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcurrent-month-scope%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * (@caimin_nwl)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/current-month-scope/#post-10025300)
 * Hi,
 * Which version of Events Manager are you using?
 *  Thread Starter [lehamill](https://wordpress.org/support/users/lehamill/)
 * (@lehamill)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/current-month-scope/#post-10025840)
 * Version 5.8.1.3
 *  [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * (@caimin_nwl)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/current-month-scope/#post-10029488)
 * Thanks. We’re investigating a similar issue reported by another user. We’ll update
   this thread when more info becomes available.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Current Month Scope’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=1039078)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/current-month-scope/#post-10029488)
 * Status: resolved