# defender-security/3.1.0/src/traits/theme.php

Defender Security – Malware Scanner, Login Security &amp; Firewall, version 3.1.0. 36 lines.

- Page: https://pluginprobe.com/plugins/defender-security/3.1.0/code/src/traits/theme.php
- Raw: https://pluginprobe.com/plugins/defender-security/3.1.0/raw/src/traits/theme.php
- Modified: 2021-05-19T09:37:22+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/defender-security/3.1.0/code/src/traits/theme.php#L10-L20`.

```php
<?php

namespace WP_Defender\Traits;

trait Theme {

	/**
	 * Get all installed themes.
	 *
	 * @return array
	 */
	public function get_themes() {
		if ( ! function_exists( 'wp_get_themes' ) ) {
			require_once( ABSPATH . '/wp-includes/theme.php' );
		}
		return wp_get_themes();
	}

	/**
	 * Get all slugs
	 *
	 * @return array
	 */
	public function get_theme_slugs() {
		$slugs = array();
		foreach ( $this->get_themes() as $slug => $theme ) {
			if ( is_object( $theme->parent() ) ) {
				continue;
			}
			$slugs[] = $slug;
		}

		return $slugs;
	}
}

```
