File manager - Edit - /home/carfac/public_html/rephotonet/wordpress/wp-content/plugins/royal-addons/shortcodes/bars.php
Back
<?php // Circular bars ([bars]) class Royal_Shortcode_Bars { public static function bars( $atts, $content = null ) { extract( shortcode_atts( array( 'mt' => '0px', 'mb' => '0px', ), $atts ) ); $mt = intval( $mt ); $mb = intval( $mb ); $style = ( $mt > 0 || $mb > 0 ) ? 'style="margin-top: ' . $mt . 'px; margin-bottom: ' . $mb . 'px;"' : ''; return '<div class="row circular-bars clearfix text-center" ' . $style . '>' . do_shortcode( $content ) . '</div>'; } public static function vc_bars() { vc_map( array( "name" => esc_html__( "Circular Bars", "royal-addons" ), "base" => "bars", "icon" => 'ti-reload', "description" => esc_html__( "Animated circles", "royal-addons" ), "as_parent" => array( "only" => "bar" ), "show_settings_on_create" => false, "js_view" => "VcColumnView", "category" => esc_html__( "Royal", "royal-addons" ), "params" => array( array( "type" => "textfield", "heading" => esc_html__( "Margin Top", "royal-addons" ), "param_name" => "mt", "value" => "0px", "description" => "", "admin_label" => true, ), array( "type" => "textfield", "heading" => esc_html__( "Margin Bottom", "royal-addons" ), "param_name" => "mb", "value" => "0px", "description" => "", "admin_label" => true, ), ) )); } // Circular bar ([bar]) public static function bar( $atts, $content = null ) { extract( shortcode_atts( array( 'title' => '', 'column' => '1/6', 'value' => 75, 'class' => '' ), $atts ) ); return '<div class="res-margin col-xs-12 col-sm-4 col-md-' . Royal_Shortcodes::getColumnsNumber( $column ) . ( ! empty( $class ) ? ' ' . esc_attr( $class ) : '' ) . ' text-center"><p><input data-value="' . intval( $value ) . '" disabled></p><div class="h5">' . esc_html( $title ) . '</div></div>'; } public static function vc_bar() { vc_map( array( "name" => esc_html__( "Circular Bar", "royal-addons" ), "base" => "bar", "icon" => 'ti-reload', "as_child" => array( "only" => "bars" ), "category" => esc_html__( "Royal", "royal-addons" ), "params" => array( array( "type" => "textfield", "heading" => esc_html__( "Title", "royal-addons" ), "param_name" => "title", "value" => "", "description" => "", "admin_label" => true, ), array( "type" => "dropdown", "holder" => "div", "class" => "", "heading" => esc_html__( "Column", "royal-addons" ), "param_name" => "column", "value" => array( "1/2" => '1/2', "1/3" => '1/3', "1/4" => '1/4', "1/5" => '1/5', "1/6" => '1/6' ), "std" => "1/5", "description" => "", "admin_label" => true, ), array( "type" => "textfield", "heading" => esc_html__( "Value", "royal-addons" ), "param_name" => "value", "value" => "75", "description" => "Number between 0 and 100", "admin_label" => true, ), array( "type" => "textfield", "heading" => esc_html__( "CSS Class", "royal-addons" ), "param_name" => "class", "value" => "", "description" => "", "admin_label" => true, ), ) )); } } add_shortcode( 'bars', array( 'Royal_Shortcode_Bars', 'bars' ) ); add_shortcode( 'bar', array( 'Royal_Shortcode_Bars', 'bar' ) ); add_action( 'vc_before_init', array( 'Royal_Shortcode_Bars', 'vc_bars' ) ); add_action( 'vc_before_init', array( 'Royal_Shortcode_Bars', 'vc_bar' ) ); // Nested shortcodes add_action( 'vc_before_init', function() { // Circular bars extend if (class_exists( 'WPBakeryShortCodesContainer' )) { class WPBakeryShortCode_bars extends WPBakeryShortCodesContainer {}; } if (class_exists( 'WPBakeryShortCode' )) { class WPBakeryShortCode_bar extends WPBakeryShortCode {}; } });
| ver. 1.4 |
Github
|
.
| PHP 8.2.31 | Generation time: 0.4 |
proxy
|
phpinfo
|
Settings