| Server IP : 68.183.124.220 / Your IP : 216.73.217.137 Web Server : Apache/2.4.18 (Ubuntu) System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : gavin ( 1000) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/wp-content/plugins/popup-builder/com/helpers/ |
Upload File : |
<?php
namespace sgpb;
/**
* Popup Builder Includer
*
* @since 2.5.6
*
* Register and enqueue popup styles and js files
*
*/
class ScriptsIncluder
{
/**
* Popup register style
*
* @since 2.5.6
*
* @param string $fileName file address
* @param array $args wordpress register style args dep|ver|media|dirUrl
*
* @return void
*/
public static function registerStyle($fileName, $args = array())
{
if(empty($fileName)) {
return;
}
$dep = array();
$ver = SG_POPUP_VERSION;
$media = 'all';
$dirUrl = SG_POPUP_CSS_URL;
if(!empty($args['dep'])) {
$dep = $args['dep'];
}
if(!empty($args['ver'])) {
$ver = $args['ver'];
}
if(!empty($args['media'])) {
$media = $args['media'];
}
if(!empty($args['dirUrl'])) {
$dirUrl = $args['dirUrl'];
}
wp_register_style($fileName, $dirUrl.''.$fileName, $dep, $ver, $media);
}
/**
* Popup register style
*
* @since 2.5.6
*
* @param string $fileName file address
*
* @return void
*/
public static function enqueueStyle($fileName)
{
if(empty($fileName)) {
return;
}
wp_enqueue_style($fileName);
}
/**
* Popup register style
*
* @since 2.5.6
*
* @param string $fileName file address
* @param array $args wordpress register script args dep|ver|inFooter|dirUrl
*
* @return void
*/
public static function registerScript($fileName, $args = array())
{
if(empty($fileName)) {
return;
}
$dep = array();
$ver = SG_POPUP_VERSION;
$inFooter = false;
$dirUrl = SG_POPUP_JS_URL;
if(!empty($args['dep'])) {
$dep = $args['dep'];
}
if(!empty($args['ver'])) {
$ver = $args['ver'];
}
if(!empty($args['inFooter'])) {
$inFooter = $args['inFooter'];
}
if(!empty($args['dirUrl'])) {
$dirUrl = $args['dirUrl'];
}
wp_register_script($fileName, $dirUrl.''.$fileName, $dep, $ver, $inFooter);
}
/**
* Popup register style
*
* @since 2.5.6
*
* @param string $fileName file address
*
* @return void
*/
public static function enqueueScript($fileName)
{
if(empty($fileName)) {
return;
}
wp_enqueue_script($fileName);
}
public static function localizeScript($handle, $name, $data)
{
wp_localize_script($handle, $name, $data);
}
}