| Server IP : 89.39.208.18 / Your IP : 216.73.217.74 Web Server : LiteSpeed System : User : ( ) PHP Version : 7.4.33 Disable Function : eval,./,ln,passthru,dl,system,exec,popen,shell_exec,posix_getpwuid,posix_uname,ftp_exec,posix_uname,posix_getpwuid,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,get_current_user,getmyuid,getmygid,listen,chgrp,apache_note,apache_setenv,apache_child_terminate,closelog,debugger_off,debugge_on,ini_restore,netscript,escapeshellarg,cmd,backtick,virtual,show_sourc,show_source,pclose,pcntl_exec,datasec,old_offset,ctrl_dir,ini_alter,leak,listen,chgrp,apache_setenv,define_syslog_variables,root,diskfreespace,disk_free_space,disk_total_space,posix_kill,getmyuid,getmygid,apache_child_terminate,php_ini_scanned_files,ls,ps_aux,chown,getrusage,posixc,posame,chgrp,posix_setuid,posix_setsid,posix_setgid,apache_note,apache_setenv,x_getuid,e_ini_file,nfo,SQL,mysql_li,t_dbs,filegroup,highlight_file,ilegetcontents,get_dir,popen,popens,pfsockopen,dos_conv,apache_get_modules,crack_check,crack_closedict,rar_open,bzopen,bzread,bzwrite,shellcode,posix_isatty,posix_getservbyname,escapeshellarg,hypot,pg_host,pos,posix_access,inurl,posix_times,posix_mknod,pclose,ps_fill,symlink,id,escapeshellcmd,php_uname,phpinfo MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home3/./././././mahyarcake/public_html/wp-content/plugins/elementor-pro/modules/lottie/ |
Upload File : |
<?php
namespace ElementorPro\Modules\Lottie;
use ElementorPro\Base\Module_Base;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Module extends Module_Base {
public function __construct() {
parent::__construct();
add_filter( 'wp_check_filetype_and_ext', [ $this, 'handle_file_type' ], 10, 3 );
add_filter( 'elementor_pro/frontend/localize_settings', [ $this, 'localize_settings' ] );
add_action( 'elementor/frontend/before_register_scripts', [ $this, 'register_frontend_scripts' ] );
}
/**
* Get module name.
*
* Retrieve the module name.
*
* @since 2.7.0
* @access public
*
* @return string Module name.
*/
public function get_name() {
return 'lottie';
}
public function get_widgets() {
return [
'lottie',
];
}
// Fixing wordpress problem when `finfo_file()` returns wrong file type
public function handle_file_type( $file_data, $file, $filename ) {
if ( $file_data['ext'] && $file_data['type'] ) {
return $file_data;
}
$filetype = wp_check_filetype( $filename );
if ( 'json' === $filetype['ext'] ) {
$file_data['ext'] = 'json';
$file_data['type'] = 'application/json';
}
return $file_data;
}
public function register_frontend_scripts() {
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_register_script(
'lottie',
ELEMENTOR_PRO_URL . 'assets/lib/lottie/lottie' . $suffix . '.js',
[
'jquery',
],
'5.6.6',
true
);
}
public function localize_settings( array $settings ) {
$settings['lottie']['defaultAnimationUrl'] = ELEMENTOR_PRO_MODULES_URL . 'lottie/assets/animations/default.json';
return $settings;
}
}