/** * Get Available css themes * * Function is not intended to be called directly. Use `wprainbow_get_available_themes()` instead. * * @use private * * @return array Assoc containing all avaliable themes with theme slugs as key and prettified theme slugs values. */ function get_available_themes() { $theme_instance = new WP_Theme('themes', plugin_dir_path(__FILE__) . 'css'); $css_files = $theme_instance->get_files('css'); $themes = array(); foreach ($css_files as $filename => $path) { $filename = basename($filename, '.css'); $themes[$filename] = ucwords(str_replace('-', ' ', $filename)); } return apply_filters('wprainbow_available_themes', $themes); }