diff --git a/src/Api/Script.php b/src/Api/Script.php index 90f5feb..969f908 100755 --- a/src/Api/Script.php +++ b/src/Api/Script.php @@ -96,26 +96,27 @@ public function getDependencies(): array /** * Script version. - * @var string $version + * @var int|string $version */ - protected string $version; + protected int|string $version; /** * Set the Script version. - * @param string $version + * @param int|string $version */ - public function setVersion(string $version = '0.0.1'): void + public function setVersion(int|string $version = ''): void { $this->version = $version; } /** * Get the Script version. - * @return string + * @return int|string */ - public function getVersion(): string + public function getVersion(): int|string { - return $this->version ?? '0.0.1'; + global $wp_version; + return $this->version === '' ? $wp_version : $this->version; } /** diff --git a/src/Api/Style.php b/src/Api/Style.php index c906423..8bcda8a 100755 --- a/src/Api/Style.php +++ b/src/Api/Style.php @@ -94,26 +94,27 @@ public function getDependencies(): array /** * Style version. - * @var string $version + * @var int|string $version */ - protected string $version; + protected int|string $version; /** * Set Style version. - * @param string $version + * @param int|string $version */ - public function setVersion(string $version = '0.0.1'): void + public function setVersion(int|string $version = ''): void { $this->version = $version; } /** * Get Style version. - * @return string + * @return int|string */ - public function getVersion(): string + public function getVersion(): int|string { - return $this->version ?? '0.0.1'; + global $wp_version; + return $this->version === '' ? $wp_version : $this->version; } /**