Habari\Themes::preview_theme PHP Метод

preview_theme() публичный статический Метод

Sets a theme to be the current user's preview theme
public static preview_theme ( string $theme_name, string $theme_dir )
$theme_name string The name of the theme to preview
$theme_dir string The directory of the theme to preview
    public static function preview_theme($theme_name, $theme_dir)
    {
        $ok = Themes::validate_theme($theme_dir);
        if ($ok) {
            $_SESSION['user_theme_name'] = $theme_name;
            $_SESSION['user_theme_dir'] = $theme_dir;
            // Execute the theme's activated action
            $preview_theme = Themes::create();
            Plugins::act_id('theme_activated', $preview_theme->plugin_id(), $theme_name, $preview_theme);
            EventLog::log(_t('Previewed Theme: %s', array($theme_name)), 'notice', 'theme', 'habari');
        }
        return $ok;
    }