src/Core/Console/ThemeInstallCommand.php
protected function setAsDefaultTheme(string $name)
    {
        if (! file_exists($file = config_path('wordpress.php'))) {
            $this->warn('Cannot update default theme configuration.');

            return;
        }

        $this->info('Set default theme constant...');
        $lines = file($file);

        $content = array_map(function ($line) use ($name) {
            if (stristr($line, 'WP_DEFAULT_THEME')) {
                return "define('WP_DEFAULT_THEME', '{$name}');\r\n";
            }

            return $line;
        }, $lines);

        $this->files->put($file, implode('', $content));
    }
protected function setAsDefaultTheme(string $name)
    {
        if (! file_exists($file = config_path('wordpress.php'))) {
            $this->warn('Cannot update default theme configuration.');

            return;
        }

        $this->info('Set default theme constant...');
        $lines = file($file);

        $content = array_map(function ($line) use ($name) {
            if (stristr($line, 'WP_DEFAULT_THEME')) {
                return "define('WP_DEFAULT_THEME', '{$name}');\r\n";
            }

            return $line;
        }, $lines);

        $this->files->put($file, implode('', $content));
    }
protected function setAsDefaultTheme ( string $ name ) { if ( ! file_exists ( $ file = config_path ( 'wordpress.php' ) ) ) { $ this -> warn ( 'Cannot update default theme configuration.' ) ; return ; } $ this -> info ( 'Set default theme constant...' ) ; $ lines = file ( $ file ) ; $ content = array_map ( function ( $ line ) use ( $ name ) { if ( stristr ( $ line , 'WP_DEFAULT_THEME' ) ) { return "define('WP_DEFAULT_THEME', '{$name}');\r\n" ; } return $ line ; } , $ lines ) ; $ this -> files -> put ( $ file , implode ( '' , $ content ) ) ; }
Set default theme constant in main "wordpress.php" config file.

@param string $name
Set default theme constant in main wordpress . php config file .