| Server IP : 38.190.208.107 / Your IP : 216.73.217.99 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : www ( 1000) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/wp.4/wp-content/themes/woodmart/inc/integrations/visual-composer/fields/new/ |
Upload File : |
<?php
/**
* This file has function for rendering Number field.
*
* @package woodmart.
*/
if ( ! defined( 'WOODMART_THEME_DIR' ) ) {
exit( 'No direct script access allowed' );
}
if ( ! function_exists( 'woodmart_get_number_param' ) ) {
/**
* This function rendering Number field.
*
* @param array $settings Settings.
* @param string $value Value.
*
* @return false|string
*/
function woodmart_get_number_param( $settings, $value ) {
$data = json_decode( woodmart_decompress( $value ), true );
if ( isset( $data['devices'] ) ) {
$settings['devices'] = $data['devices'];
}
ob_start();
?>
<div class="xts-numbers">
<?php if ( 1 < count( $settings['devices'] ) ) : ?>
<div class="wd-field-devices">
<?php foreach ( $settings['devices'] as $device => $device_settings ) : ?>
<?php
$device_classes = ' wd-' . $device;
if ( array_key_first( $settings['devices'] ) === $device ) {
$device_classes .= ' xts-active';
}
?>
<span class="wd-device<?php echo esc_attr( $device_classes ); ?>" data-value="<?php echo esc_attr( $device ); ?>" title="<?php echo esc_attr( ucfirst( $device ) ); ?>">
<span><?php echo esc_html( $device ); ?></span>
</span>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php foreach ( $settings['devices'] as $device => $device_settings ) : ?>
<?php
$classes = '';
if ( array_key_first( $settings['devices'] ) === $device ) {
$classes .= ' xts-active';
}
?>
<input aria-label="<?php esc_attr_e( 'Number', 'woodmart' ); ?>" type="number" class="xts-number xts-z-index-input<?php echo esc_attr( $classes ); ?>" min="<?php echo esc_attr( $settings['min'] ); ?>" max="<?php echo esc_attr( $settings['max'] ); ?>" step="<?php echo esc_attr( $settings['step'] ); ?>" data-device="<?php echo esc_attr( $device ); ?>" placeholder="<?php echo isset( $device_settings['placeholder'] ) ? esc_attr( $device_settings['placeholder'] ) : ''; ?>" value="<?php echo esc_attr( $device_settings['value'] ); ?>">
<?php endforeach; ?>
<input type="hidden" class="wpb_vc_param_value" name="<?php echo esc_attr( $settings['param_name'] ); ?>" value="<?php echo esc_attr( $value ); ?>" data-settings="<?php echo esc_attr( wp_json_encode( $settings ) ); ?>">
</div>
<?php
return ob_get_clean();
}
}