| Server IP : 68.178.247.200 / Your IP : 216.73.216.14 Web Server : Apache System : Linux p3plzcpnl489463.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64 User : x9dppmxs4rgd ( 8559391) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/x9dppmxs4rgd/www/wp-content/plugins/wordfence/modules/login-security/classes/model/ |
Upload File : |
<?php
namespace WordfenceLS;
class Model_Script extends Model_Asset {
private $translations = array();
private $translationObjectName = null;
public function enqueue() {
if ($this->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;
?>
<script type="text/javascript" src="<?php echo esc_attr($this->getSourceUrl()) ?>"></script>
<?php
}
public function register() {
wp_register_script($this->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;
}
}