| Server IP : 60.247.133.247 / Your IP : 216.73.217.108 Web Server : Apache System : Linux ebs-119054 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64 User : goodwill ( 65985) PHP Version : 8.2.20 Disable Function : link,symlink,passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server,pcntl_fork,pcntl_rfork MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/wwwroot/goodwill/wwwroot/wp-content/plugins/Ultimate_VC_Addons/params/ |
Upload File : |
<?php
/**
* Usage -
* array(
* "type" => "ultimate_margins",
* "positions" => array(
* "Top" => "top",
* "Bottom" => "bottom",
* "Left" => "left",
* "Right" => "right"
* ),
* ),
*
* @package Ultimate_VC_Addons_Margin_Param.
*/
if ( ! class_exists( 'Ultimate_VC_Addons_Margin_Param' ) ) {
/**
* Class Ultimate_VC_Addons_Margin_Param
*
* @class Ultimate_VC_Addons_Margin_Param.
*/
class Ultimate_VC_Addons_Margin_Param {
/**
* Initiator __construct.
*/
public function __construct() {
if ( defined( 'WPB_VC_VERSION' ) && version_compare( WPB_VC_VERSION, 4.8 ) >= 0 ) {
if ( function_exists( 'vc_add_shortcode_param' ) ) {
vc_add_shortcode_param( 'ultimate_margins', array( $this, 'ultimate_margins_param' ), UAVC_URL . 'admin/vc_extend/js/vc-headings-param.js' );
}
} else {
if ( function_exists( 'add_shortcode_param' ) ) {
add_shortcode_param( 'ultimate_margins', array( $this, 'ultimate_margins_param' ), UAVC_URL . 'admin/vc_extend/js/vc-headings-param.js' );
}
}
}
/**
* Ultimate_margins_param.
*
* @param array $settings Settings.
* @param string $value Value.
*/
public function ultimate_margins_param( $settings, $value ) {
$dependency = '';
$positions = $settings['positions'];
$html = '<div class="ultimate-margins">
<input type="hidden" name="' . esc_attr( $settings['param_name'] ) . '" class="wpb_vc_param_value ultimate-margin-value ' . esc_attr( $settings['param_name'] ) . ' ' . esc_attr( $settings['type'] ) . '_field" value="' . esc_attr( $value ) . '" ' . $dependency . '/>';
foreach ( $positions as $key => $position ) {
$html .= esc_attr( $key ) . ' <input type="text" style="width:50px;padding:3px" data-hmargin="' . esc_attr( $position ) . '" class="ultimate-margin-inputs" id="margin-' . esc_attr( $key ) . '" /> ';
}
$html .= '</div>';
return $html;
}
}
}
if ( class_exists( 'Ultimate_VC_Addons_Margin_Param' ) ) {
$ultimate_margin_param = new Ultimate_VC_Addons_Margin_Param();
}