| Server IP : 69.72.244.102 / Your IP : 216.73.216.164 Web Server : LiteSpeed System : Linux s3434.fra1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64 User : konzalta ( 1271) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/konzalta/www/wp-content/plugins/wemail/includes/FrontEnd/ |
Upload File : |
<?php
namespace WeDevs\WeMail\FrontEnd;
use WeDevs\WeMail\Traits\Hooker;
use WeDevs\WeMail\WeMail;
class Scripts {
use Hooker;
public function __construct() {
$this->add_action( 'wp_enqueue_scripts', 'scripts' );
}
public function scripts() {
$this->enqueue_scripts();
}
public function enqueue_scripts() {
if ( ! is_wemail_hmr_enable() ) {
wp_register_script( 'wemail-frontend-vendor', wemail()->wemail_cdn . '/build/js/frontend-vendor.js', array( 'jquery' ), WEMAIL_VERSION, true );
wp_register_script( 'wemail-frontend', wemail()->wemail_cdn . '/build/js/frontend.js', array( 'wemail-frontend-vendor' ), WEMAIL_VERSION, true );
} else {
$hmr_host = wemail()->hmr_host();
wp_register_script( 'wemail-frontend-vendor', $hmr_host . '/src/js/frontend/frontend-vendor.js', array( 'jquery' ), WEMAIL_VERSION, true );
wp_register_script( 'wemail-frontend', $hmr_host . '/src/js/frontend/frontend.js', array( 'wemail-frontend-vendor' ), WEMAIL_VERSION, true );
}
$wemail = array(
'restURL' => untrailingslashit( get_rest_url( null, '/wemail/v1' ) ),
'nonce' => wp_create_nonce( 'wp_rest' ),
'cdn' => wemail()->wemail_cdn,
);
wp_localize_script( 'wemail-frontend-vendor', 'weMail', $wemail );
WeMail::register_module_scripts();
}
}