eventType = new EventType(EventType::THEME_SWITCHED); parent::__construct($track); } /** * Theme update tracking handler. * * @since 2.10.0 * * @param bool|WP_Upgrader $upgrader * @param array $data */ public function themeUpdateTrackingHandler($upgrader = false, $data = []) { // Return if it's not a WordPress core update. if ( ! $upgrader || ! isset($data['type']) || 'theme' !== $data['type']) { return; } foreach ($data['themes'] as $theme) { if (get_stylesheet() === $theme || get_template() === $theme || $this->isParentTheme($theme)) { $this->trackId = new EventType(EventType::THEME_UPDATED); $this->record(); } } } }