/** * Use this 'wpak_theme_is_asset_file' filter to make * a file or a mime type accessible by the app without * checking the app id and the app theme. * @see self::template_redirect() */ return apply_filters('wpak_theme_is_asset_file', $is_asset_file, $file, $mime_type); } /** * Checks if the given theme exists and has the mandatory themes files */ public static function is_theme($theme_slug) { $is_theme = false; $theme_path = self::get_themes_directory() . '/' . $theme_slug . '/'; if (is_dir($theme_path)) { $is_theme = file_exists($theme_path . 'layout.html') && file_exists($theme_path . 'js/functions.js'); } return $is_theme; } /** * Checks if the given theme is used at least by one app */ public static function theme_is_used($theme_slug) { $used_themes = WpakThemesStorage::get_used_themes(); return in_array($theme_slug, $used_themes); } } WpakThemes::hooks();