| Server IP : 212.183.175.188 / Your IP : 216.73.217.18 Web Server : Apache System : Linux duemilacom6.interac.it 5.10.0-28-amd64 #1 SMP Debian 5.10.209-2 (2024-01-31) x86_64 User : cvevolpi ( 10022) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/cvevolpi.it/httpdocs/wp-content/themes/sentinel/visualComposer/ |
Upload File : |
<?php
// ------------------------------------------------------------------------------
// BUTTON
// ------------------------------------------------------------------------------
function vc_theme_vc_information_block($atts, $content = null) {
$defaults = array (
'button_title' => 'title',
'href' => '#',
'el_class' => '',
)
;
// var_dump( $content );
$atts = sc_default_params ( $defaults, $atts );
$text .= '<div class="info_block clearfix">';
$text .= '<div class="left">';
$text .= '<h3 class="info_title">'.$atts['title'].'</h3>';
$text .= wpb_js_remove_wpautop( do_shortcode( $content ) );
$text .= '</div>';
$text .= '<div class="right">';
$class [] = 'sc_button';
$class [] = 'sc_button_' . $atts ['type'];
$class [] = 'sc_button_' . $atts ['size'];
$class [] = 'sc_button_' . $atts ['color'];
if( !empty( $atts['el_class'] ) ) {
$class [] = $atts['el_class'];
}
$class = implode ( ' ', $class );
$text .= '<a class="' . $class . '" href="' . $atts ['href'] . '">' . $atts ['button_title'] . '</a>';
$text .= '</div>';
$text .= '</div>';
return wpb_js_remove_wpautop ( $text );
}
add_shortcode ( 'vc_information_block', 'vc_theme_vc_information_block' );
$size_arr = array(
"Small" => "small",
"Medium" => "medium",
"Large" => "large",
);
$colors_arr = array(
'Burgundy' => 'burgundy',
'Magenta' =>'magenta',
'Red' =>'red',
'Orange' =>'orange',
'Pink' => 'pink',
'Cobalt' => 'cobalt',
'Blue' => 'blue',
'Cyan' =>'cyan',
'Green' => 'green',
"Light" => "light",
"Dark" => "dark",
);
vc_map ( array (
"name" => __ ( "Information Block", "js_composer" ),
"base" => "vc_information_block",
"icon" => "icon-wpb-ui-button",
"category" => __ ( 'Content', 'js_composer' ),
"params" => array (
array (
"type" => "textfield",
"heading" => __ ( "Title", "js_composer" ),
"param_name" => "title",
"description" => __ ( "Component Title", "js_composer" )
),
array(
"type" => "textarea_html",
"holder" => "div",
"heading" => __("Text", "js_composer"),
"param_name" => "content",
"value" => __("<p>I am text block. Click edit button to change this text.</p>", "js_composer")
),
array (
"type" => "textfield",
"heading" => __ ( "Text on the button", "js_composer" ),
"holder" => "button",
"class" => "wpb_button",
"param_name" => "button_title",
"value" => __ ( "Browse our Website", "js_composer" ),
"description" => __ ( "Text on the button.", "js_composer" )
),
array (
"type" => "textfield",
"heading" => __ ( "URL (Link)", "js_composer" ),
"param_name" => "href",
"description" => __ ( "Button link.", "js_composer" )
),
array (
"type" => "dropdown",
"heading" => __ ( "Color", "js_composer" ),
"param_name" => "color",
"value" => $colors_arr,
"description" => __ ( "Button color.", "js_composer" )
),
// ------------- ADDED
array (
"type" => "dropdown",
"heading" => __ ( "Type", "js_composer" ),
"param_name" => "type",
"description" => __ ( "Type", "js_composer" ),
"value" => array(
"Square" => "square",
"Round" => "round",
),
),
array (
"type" => "dropdown",
"heading" => __ ( "Size", "js_composer" ),
"param_name" => "size",
"value" => $size_arr,
"description" => __ ( "Button size.", "js_composer" )
),
array (
"type" => "textfield",
"heading" => __ ( "Extra class name", "js_composer" ),
"param_name" => "el_class",
"description" => __ ( "If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "js_composer" )
)
),
"js_view" => 'VcButtonView'
) );