| @@ 958-986 (lines=29) @@ | ||
| 955 | } |
|
| 956 | ||
| 957 | ||
| 958 | protected function _trash_or_restore_venues($venue_status = 'trash') |
|
| 959 | { |
|
| 960 | // clean status |
|
| 961 | $venue_status = sanitize_key($venue_status); |
|
| 962 | // grab status |
|
| 963 | if (! empty($venue_status)) { |
|
| 964 | $success = true; |
|
| 965 | // determine the event id and set to array. |
|
| 966 | $VNU_IDs = isset($this->_req_data['venue_id']) ? (array) $this->_req_data['venue_id'] : array(); |
|
| 967 | // loop thru events |
|
| 968 | foreach ($VNU_IDs as $VNU_ID) { |
|
| 969 | if ($VNU_ID = absint($VNU_ID)) { |
|
| 970 | $results = $this->_change_venue_status($VNU_ID, $venue_status); |
|
| 971 | $success = $results !== false ? $success : false; |
|
| 972 | } else { |
|
| 973 | $msg = sprintf( |
|
| 974 | __( |
|
| 975 | 'An error occurred. Venue #%d could not be moved to the trash because a valid venue ID was not not supplied.', |
|
| 976 | 'event_espresso' |
|
| 977 | ), |
|
| 978 | $VNU_ID |
|
| 979 | ); |
|
| 980 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
| 981 | $success = false; |
|
| 982 | } |
|
| 983 | } |
|
| 984 | } else { |
|
| 985 | $success = false; |
|
| 986 | $msg = __( |
|
| 987 | 'An error occurred. The venue could not be moved to the trash because a valid venue status was not not supplied.', |
|
| 988 | 'event_espresso' |
|
| 989 | ); |
|
| @@ 1988-2017 (lines=30) @@ | ||
| 1985 | * @param string $event_status |
|
| 1986 | * @return void |
|
| 1987 | */ |
|
| 1988 | protected function _trash_or_restore_events($event_status = 'trash') |
|
| 1989 | { |
|
| 1990 | // clean status |
|
| 1991 | $event_status = sanitize_key($event_status); |
|
| 1992 | // grab status |
|
| 1993 | if (! empty($event_status)) { |
|
| 1994 | $success = true; |
|
| 1995 | // determine the event id and set to array. |
|
| 1996 | $EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : array(); |
|
| 1997 | // loop thru events |
|
| 1998 | foreach ($EVT_IDs as $EVT_ID) { |
|
| 1999 | if ($EVT_ID = absint($EVT_ID)) { |
|
| 2000 | $results = $this->_change_event_status($EVT_ID, $event_status); |
|
| 2001 | $success = $results !== false ? $success : false; |
|
| 2002 | } else { |
|
| 2003 | $msg = sprintf( |
|
| 2004 | esc_html__( |
|
| 2005 | 'An error occurred. Event #%d could not be moved to the trash because a valid event ID was not not supplied.', |
|
| 2006 | 'event_espresso' |
|
| 2007 | ), |
|
| 2008 | $EVT_ID |
|
| 2009 | ); |
|
| 2010 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
| 2011 | $success = false; |
|
| 2012 | } |
|
| 2013 | } |
|
| 2014 | } else { |
|
| 2015 | $success = false; |
|
| 2016 | $msg = esc_html__( |
|
| 2017 | 'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.', |
|
| 2018 | 'event_espresso' |
|
| 2019 | ); |
|
| 2020 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|