| @@ 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 | ); | |
| @@ 1979-2008 (lines=30) @@ | ||
| 1976 | * @param string $event_status | |
| 1977 | * @return void | |
| 1978 | */ | |
| 1979 | protected function _trash_or_restore_events($event_status = 'trash') | |
| 1980 |     { | |
| 1981 | // clean status | |
| 1982 | $event_status = sanitize_key($event_status); | |
| 1983 | // grab status | |
| 1984 |         if (! empty($event_status)) { | |
| 1985 | $success = true; | |
| 1986 | // determine the event id and set to array. | |
| 1987 | $EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : array(); | |
| 1988 | // loop thru events | |
| 1989 |             foreach ($EVT_IDs as $EVT_ID) { | |
| 1990 |                 if ($EVT_ID = absint($EVT_ID)) { | |
| 1991 | $results = $this->_change_event_status($EVT_ID, $event_status); | |
| 1992 | $success = $results !== false ? $success : false; | |
| 1993 |                 } else { | |
| 1994 | $msg = sprintf( | |
| 1995 | esc_html__( | |
| 1996 | 'An error occurred. Event #%d could not be moved to the trash because a valid event ID was not not supplied.', | |
| 1997 | 'event_espresso' | |
| 1998 | ), | |
| 1999 | $EVT_ID | |
| 2000 | ); | |
| 2001 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); | |
| 2002 | $success = false; | |
| 2003 | } | |
| 2004 | } | |
| 2005 |         } else { | |
| 2006 | $success = false; | |
| 2007 | $msg = esc_html__( | |
| 2008 | 'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.', | |
| 2009 | 'event_espresso' | |
| 2010 | ); | |
| 2011 | EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); | |