File manager - Edit - /home/carfac/public_html/rephotonet/wordpress/wp-content/plugins/royal-addons/shortcodes/counters.php
Back
<?php // Milestone counters ([milestone]) class Royal_Shortcode_Milestone_Counters { public static function milestone( $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" ' . $style . '>' . do_shortcode( $content ) . '</div>'; } public static function vc_milestone() { vc_map( array( "name" => esc_html__( "Counters", "royal-addons" ), "base" => "milestone", "icon" => 'ti-star', "description" => esc_html__( "Milestone numbers", "royal-addons" ), "as_parent" => array( "only" => "counter" ), "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, ), ) )); } // Milestone counter ([counter]) public static function counter( $atts, $content = null ) { extract( shortcode_atts( array( 'title' => '', 'icon' => '', 'from' => '1', 'to' => '100', 'column' => '1/4', 'color' => '', 'class' => '', ), $atts ) ); return '<div class="res-margin col-md-' . Royal_Shortcodes::getColumnsNumber( $column ) . ( ! empty( $class ) ? ' ' . esc_attr( $class ) : '' ) . '"><p class="text-center"><i class="' . esc_html( $icon ). ' fa-3x fw"' . ( ! empty( $color ) ? ' style="color: ' . esc_attr( $color ) . ';"' : '' ) . '></i></p><div class="milestone"><div class="counter" data-from="' . intval( $from ) . '" data-to="' . intval( $to ) . '">' . $to . '</div><div class="description">' . esc_html( $title ) . '</div></div></div>'; } public static function vc_counter() { vc_map( array( "name" => esc_html__( "Milestone Counter", "royal-addons" ), "base" => "counter", "icon" => 'ti-star', "as_child" => array( "only" => "milestone" ), "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", "heading" => esc_html__( "Icon library", "royal-addons" ), "value" => array( esc_html__( "Font Awesome", "royal-addons" ) => "fontawesome", ), "admin_label" => false, "param_name" => "type", "description" => "", ), array( "type" => "iconpicker", "heading" => esc_html__( "Icon", "royal-addons" ), "param_name" => "icon", "value" => "", "settings" => array( "emptyIcon" => true, "iconsPerPage" => 4000, ), "dependency" => array( "element" => "type", "value" => "fontawesome", ), ), array( "type" => "textfield", "heading" => esc_html__( "From", "royal-addons" ), "param_name" => "from", "value" => "1", "description" => "", "admin_label" => true, ), array( "type" => "textfield", "heading" => esc_html__( "To", "royal-addons" ), "param_name" => "to", "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/6" => '1/6' ), "std" => "1/4", "description" => "", "admin_label" => true, ), array( "type" => "colorpicker", "heading" => esc_html__( "Color", "royal-addons" ), "param_name" => "color", "value" => "", "description" => "", "admin_label" => true, ), array( "type" => "textfield", "heading" => esc_html__( "CSS Class", "royal-addons" ), "param_name" => "class", "value" => "", "description" => "", "admin_label" => true, ), ) )); } } add_shortcode( 'milestone', array( 'Royal_Shortcode_Milestone_Counters', 'milestone' ) ); add_shortcode( 'counter', array( 'Royal_Shortcode_Milestone_Counters', 'counter' ) ); add_action( 'vc_before_init', array( 'Royal_Shortcode_Milestone_Counters', 'vc_milestone' ) ); add_action( 'vc_before_init', array( 'Royal_Shortcode_Milestone_Counters', 'vc_counter' ) ); // Nested shortcodes add_action( 'vc_before_init', function() { // Milestone counters extend if (class_exists( 'WPBakeryShortCodesContainer' )) { class WPBakeryShortCode_milestone extends WPBakeryShortCodesContainer {}; } if (class_exists( 'WPBakeryShortCode' )) { class WPBakeryShortCode_counter extends WPBakeryShortCode {}; } });
| ver. 1.4 |
Github
|
.
| PHP 8.2.31 | Generation time: 0.25 |
proxy
|
phpinfo
|
Settings