| 1 |
<?php |
| 2 |
namespace epiphyt\Embed_Privacy\handler; |
| 3 |
|
| 4 |
/** |
| 5 |
* Theme handler. |
| 6 |
* |
| 7 |
* @author Epiphyt |
| 8 |
* @license GPL2 |
| 9 |
* @package epiphyt\Embed_Privacy |
| 10 |
* @since 1.10.0 |
| 11 |
*/ |
| 12 |
final class Theme { |
| 13 |
/** |
| 14 |
* Check if the current theme is matching your name. |
| 15 |
* |
| 16 |
* @param string $name The theme name to test |
| 17 |
* @return bool True if the current theme is matching, false otherwise |
| 18 |
*/ |
| 19 |
public static function is( $name ) { |
| 20 |
$name = \strtolower( $name ); |
| 21 |
$theme_name = \strtolower( \wp_get_theme()->get( 'Name' ) ); |
| 22 |
$theme_template = \strtolower( \wp_get_theme()->get( 'Template' ) ); |
| 23 |
|
| 24 |
return $theme_name === $name || $theme_template === $name; |
| 25 |
} |
| 26 |
} |
| 27 |
|