You are here

function getRootDir in Gutenberg 8

1 call to getRootDir()
gutenberg-dependencies.php in scripts/gutenberg-dependencies.php
Gets Gutenberg dependencies.

File

scripts/gutenberg-dependencies.php, line 22
Gets Gutenberg dependencies.

Code

function getRootDir() {
  $dirs = explode(DIRECTORY_SEPARATOR, __DIR__);
  $root_dir = [];
  foreach ($dirs as $key => $value) {
    if ($value === 'modules') {
      return implode(DIRECTORY_SEPARATOR, $root_dir);
    }
    $root_dir[] = $value;
  }
}