Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( ! defined( 'ABSPATH' ) ) {
- exit; # Exit if accessed directly
- }
- # String event CountDown
- add_shortcode( 'themeum_countdown_counter', function($atts, $content = null){
- extract(
- shortcode_atts(
- array(
- 'position' => 'left',
- 'date' => '',
- "title" => '',
- "title_fontsize" => '',
- "class" =>'',
- ),
- $atts
- ));
- global $post;
- $output = $align = '';
- if($position) $align .= 'text-align:'. esc_attr( $position ) .';';
- $output .= '<div class="wpb_wrapper">';
- $output .= '<div class="shortcode-event-countdown string-countdown-wrap-cont '.esc_attr($class).'" style="'. $align .'">';
- $countdate = str_replace('-', '-', $date);
- $output .= '<div class="counter-class" data-date="'.$countdate.'">';
- $output .= '<div id="comingsoon-countdown">';
- $output .= '<div class="countdown-section"><span class="countdown-amount first-item countdown-days counter-days"></span> <span class="countdown-period">'.esc_html__( 'Days', 'themeum-core' ).'</span></div>';
- $output .= '<div class="countdown-section"><span class="countdown-amount countdown-hours counter-hours"></span> <span class="countdown-period">'.esc_html__( 'Hours', 'themeum-core' ).'</span></div>';
- $output .= '<div class="countdown-section"><span class="countdown-amount countdown-minutes counter-minutes"></span> <span class="countdown-period">'.esc_html__( 'Minutes', 'themeum-core' ).'</span></div>';
- $output .= '<div class="countdown-section"><span class="countdown-amount countdown-seconds counter-seconds"></span> <span class="countdown-period">'.esc_html__( 'Seconds', 'themeum-core' ).'</span></div>';
- $output .= '</div>';
- $output .= '</div>';
- $output .= '</div>';
- $output .= '</div>';
- return $output;
- });
- # Visual Composer
- if (class_exists('WPBakeryVisualComposerAbstract')) {
- vc_map(array(
- "name" => esc_html__("Strings Events Counter", 'themeum-core'),
- "base" => "themeum_countdown_counter",
- "icon" => "icon-thm-event-counter",
- "class" => "",
- "description" => esc_html__("Strings Events Counter addons", 'themeum-core'),
- "category" => __('Strings', 'themeum-core'),
- "params" => array(
- array(
- "type" => "dropdown",
- "heading" => esc_html__("Position", 'themeum-core'),
- "param_name" => "position",
- "value" => array('Select'=>'','Left'=>'left','Center'=>'center','Right'=>'right'),
- ),
- array(
- "type" => "textfield",
- "heading" => esc_html__("Countdown Date", 'themeum-core'),
- "param_name" => "date",
- "value" => "2020-10-10 12:34:56",
- "description" => __("Date and time format (yyyy-mm-dd hh:mm:ss) Ex. 2020-10-10 12:34:56", 'themeum-core'),
- ),
- array(
- "type" => "textfield",
- "heading" => esc_html__("Font Size", 'themeum-core'),
- "param_name" => "title_fontsize",
- "value" => "",
- ),
- array(
- "type" => "textfield",
- "heading" => esc_html__("Extra CSS Class", 'themeum-core'),
- "param_name" => "class",
- "value" => "",
- "description" => "If you wish to style particular content element differently."
- ),
- # Array end process.
- )
- ));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement