# wordpress-seo/18.5/admin/tracking/class-tracking-theme-data.php

Yoast SEO – Advanced SEO with real-time guidance and built-in AI, version 18.5. 50 lines.

- Page: https://pluginprobe.com/plugins/wordpress-seo/18.5/code/admin/tracking/class-tracking-theme-data.php
- Raw: https://pluginprobe.com/plugins/wordpress-seo/18.5/raw/admin/tracking/class-tracking-theme-data.php
- Modified: 2021-05-18T13:42:44+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wordpress-seo/18.5/code/admin/tracking/class-tracking-theme-data.php#L10-L20`.

```php
<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Admin\Tracking
 */

/**
 * Represents the theme data.
 */
class WPSEO_Tracking_Theme_Data implements WPSEO_Collection {

	/**
	 * Returns the collection data.
	 *
	 * @return array The collection data.
	 */
	public function get() {
		$theme = wp_get_theme();

		return [
			'theme' => [
				'name'        => $theme->get( 'Name' ),
				'url'         => $theme->get( 'ThemeURI' ),
				'version'     => $theme->get( 'Version' ),
				'author'      => [
					'name' => $theme->get( 'Author' ),
					'url'  => $theme->get( 'AuthorURI' ),
				],
				'parentTheme' => $this->get_parent_theme( $theme ),
			],
		];
	}

	/**
	 * Returns the name of the parent theme.
	 *
	 * @param WP_Theme $theme The theme object.
	 *
	 * @return string|null The name of the parent theme or null.
	 */
	private function get_parent_theme( WP_Theme $theme ) {
		if ( is_child_theme() ) {
			return $theme->get( 'Template' );
		}

		return null;
	}
}

```
