0 ) { if ( $action_key = array_search( $action, self::$routine_events[$routine] ) ) { remove_action( $routine_events[$routine][$action_key], $routine, $priority ); } unset(self::$routine_events[$routine]); return true; } return false; } public static function get_event_routines($event) { if (empty($event)) { return false; } $event_routines = array(); foreach(array_keys(self::$routine_events) as $routine) { if ( in_array( $event, self::$routine_events[$routine] ) ) { $event_routines[] = $routine; } } return $event_routines; } public static function get_routine_events($routine) { if (empty($routine)) { return false; } return self::$routine_events[$routine]; } public static function get_events() { $events = array(); foreach(array_keys(self::$routine_events) as $routine) { foreach(self::$routine_events[$routine] as $event) { if (!in_array($event, $events)) { $events[] = $event; } } } return $events; } public static function get_inspection_routines() { return self::get_event_routines('ac_inspection'); } public static function get_wp_hook_routines() { $wp_hook_routines = array(); foreach(array_keys(self::$routine_events) as $routine) { foreach(self::$routine_events[$routine] as $event) { if ($event != 'ac_inspection' && !in_array($routine, $wp_hook_routines)) { $wp_hook_routines[] = $routine; break; } } } return $wp_hook_routines; } public static function get_all() { return self::$routine_events; } } }