registered) { wp_enqueue_script($this->handle); } else { wp_enqueue_script($this->handle, $this->source, $this->dependencies, $this->version); } if ($this->translationObjectName && !empty($this->translations)) { wp_localize_script($this->handle, $this->translationObjectName, $this->translations); } } public function isEnqueued() { return wp_script_is($this->handle); } public function renderInline() { if (empty($this->source)) return; ?> handle, $this->source, $this->dependencies, $this->version); return parent::register(); } public function withTranslation($placeholder, $translation) { $this->translations[$placeholder] = $translation; return $this; } public function withTranslations($translations) { $this->translations = $translations; return $this; } public function setTranslationObjectName($name) { $this->translationObjectName = $name; return $this; } }