PATH:
home
/
lab2454c
/
mact34.com
/
wp-content
/
plugins
/
bdthemes-element-pack
/
includes
/
shortcodes
/
elements
<?php ep_add_shortcode([ 'id' => 'rating', 'callback' => 'ep_shortcode_rating', 'name' => __('Rating', 'bdthemes-element-pack'), 'type' => 'single', 'atts' => [ 'class' => [ 'type' => 'extra_css_class', 'name' => __('Extra CSS class', 'bdthemes-element-pack'), 'desc' => __('Additional CSS class name(s) separated by space(s)', 'bdthemes-element-pack'), 'default' => '', ], 'number' => [ 'type' => 'text', 'default' => 5, ], ], 'desc' => __('Show Rating', 'bdthemes-element-pack'), ]); function ep_shortcode_rating($atts = null) { $atts = shortcode_atts(array('class' => '', 'score' => 5), $atts, 'rating'); $ratingValue = explode(".",$atts['score']); $firstVal = $ratingValue[0]; if( $ratingValue[0]<5 ){ $secondVal = $ratingValue[1]; $secondVal = ($secondVal<5) ? 0 : 5; $score = $firstVal.'-'.$secondVal; }else{ $score = $firstVal; } $output = '<span class="epsc-rating epsc-rating-'.$score.' ' . Element_Pack_Shortcodes::ep_get_css_class($atts) . '">'; $output .= '<span class="epsc-rating-item"><i class="epsc-star" aria-hidden="true"></i></span> <span class="epsc-rating-item"><i class="epsc-star" aria-hidden="true"></i></span> <span class="epsc-rating-item"><i class="epsc-star" aria-hidden="true"></i></span> <span class="epsc-rating-item"><i class="epsc-star" aria-hidden="true"></i></span> <span class="epsc-rating-item"><i class="epsc-star" aria-hidden="true"></i></span>'; $output .= '</span>'; wp_enqueue_style('element-pack-font'); return $output; } ?>
[-] page-url.php
[edit]
[-] site-url.php
[edit]
[-] rating.php
[edit]
[-] breadcrumbs.php
[edit]
[-] current-user.php
[edit]
[-] site-title.php
[edit]
[+]
..
[-] button.php
[edit]
[-] post-date.php
[edit]
[-] label.php
[edit]
[-] clipboard.php
[edit]
[-] tag-list.php
[edit]
[-] page-title.php
[edit]
[-] countdown.php
[edit]
[-] author-name.php
[edit]
[-] tooltip.php
[edit]
[-] lightbox.php
[edit]
[-] author-avatar.php
[edit]
[-] badge.php
[edit]
[-] notification.php
[edit]
[-] current-date.php
[edit]
[-] alert.php
[edit]