MOON
Server: Apache
System: Linux server.netcommlabs.in 3.10.0-1160.83.1.el7.x86_64 #1 SMP Wed Jan 25 16:41:43 UTC 2023 x86_64
User: dermova (1051)
PHP: 5.4.45
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/dermova/www/india/wp-content/plugins/rit-core/inc/shortcode/rit_custom_heading.php
<?php

/* Products Shortcode ================================================================================== */

if (!function_exists('rit_custom_heading')) {
    function rit_custom_heading($atts, $content) {
        $atts = shortcode_atts(array(
            'heading_text' 			    => 'This is custom heading element',
            'heading_size' 	            => '',
            'heading_color'             =>'',
            'btn_name' 				    => 'Purchase',
            'bg_btn' 				    => '',
            'link_url' 				    => '#',
            'el_class' 				    => ''

        ), $atts);
        $output='';
        ob_start();
        $heading_css=$botton_css=array();
        if($atts['heading_size']){
            $heading_css[]  = str_replace( '_', '-','font-size' ) . ': ' . $atts['heading_size'].'; ';
        }
        if($atts['heading_color']){
            $heading_css[] .= vc_get_css_color( 'color', $atts['heading_color'] );
        }

        $heading_css    = ' style="' . implode( '', $heading_css ) . '"';
        if($atts['bg_btn']){
            $botton_css[]   = vc_get_css_color( 'background-color', $atts['bg_btn'] );
        }

        $botton_css     = ' style="' . implode( '', $botton_css ) . '"';

        ?>
        <div class="widget wg-custom-heading">
            <div class="widget-content clearfix">
                <div class="text-heading" <?php  echo $heading_css;?> >
                    <?php  echo $atts['heading_text']; ?>
                </div>
                <div class="buttom-heading">
                    <a class="btn btn-heading" href="<?php echo $atts['link_url'];?>" <?php echo $botton_css;?> >
                        <?php echo $atts['btn_name'];?>
                    </a>
                </div>
                <?php
                ?>
            </div>
        </div>
        <?php
        $output = ob_get_contents();
        ob_end_clean();
        return $output;


    }
}

add_shortcode('rit_heading', 'rit_custom_heading');

add_action('vc_before_init', 'rit_custom_heading_vc');

if (!function_exists('rit_custom_heading_vc')) {
    function rit_custom_heading_vc()
    {
        vc_map( array(
            'name' => __( 'RIT Custom Text',RIT_TEXT_DOMAIN),
            'base' => 'rit_heading',
            'icon' => 'icon-rit',
            'category' => __('RIT', RIT_TEXT_DOMAIN),
            'show_settings_on_create' => true,
            'description' => __( 'Text with Google fonts', RIT_TEXT_DOMAIN ),
            'params' => array(
                array(
                    'type' => 'textarea',
                    'heading' => __( 'Text', RIT_TEXT_DOMAIN ),
                    'param_name' => 'heading_text',
                    'admin_label' => true,
                    'value' => __( 'This is custom heading element', RIT_TEXT_DOMAIN ),
                    'description' => __( 'Note: If you are using non-latin characters be sure to activate them under Settings/Visual Composer/General Settings.', RIT_TEXT_DOMAIN ),
                ),
                array(
                    'type' => 'textfield',
                    'heading' => __( 'Font Size', RIT_TEXT_DOMAIN ),
                    'param_name' => 'heading_size'
                ),
                array(
                    'type' => 'colorpicker',
                    'heading' => __( 'Heading Color',RIT_TEXT_DOMAIN),
                    'param_name' => 'heading_color'
                ),

                array(
                    'type' => 'textfield',
                    'heading' => __( 'Button  name', RIT_TEXT_DOMAIN ),
                    'param_name' => 'btn_name',
                ),
                array(
                    'type' => 'colorpicker',
                    'heading' => __( 'Background Color',RIT_TEXT_DOMAIN),
                    'param_name' => 'bg_btn',
                    'description' => __( 'Select custom Background color.', RIT_TEXT_DOMAIN )
                ),
                array(
                    'type' => 'textfield',
                    'heading' => __( 'Link url', RIT_TEXT_DOMAIN ),
                    'param_name' => 'link_url',
                    'value' => '#'
                ),
                array(
                    'type' => 'textfield',
                    'heading' => __( 'Extra class name', RIT_TEXT_DOMAIN ),
                    'param_name' => 'el_class',
                    'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', RIT_TEXT_DOMAIN ),
                ),
                array(
                    'type' => 'css_editor',
                    'heading' => __( 'CSS box', RIT_TEXT_DOMAIN ),
                    'param_name' => 'css',
                    'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', RIT_TEXT_DOMAIN ),
                    'group' => __( 'Design Options', RIT_TEXT_DOMAIN )
                )
            ),
        ) );
    }
}