| Server IP : 38.190.208.107 / Your IP : 216.73.217.12 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : www ( 1000) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/wp.9/wp-content/themes/dt-the7/inc/shortcodes/includes/progress-bars/ |
Upload File : |
<?php
/**
* Progress bars shortcode.
*
*/
// File Security Check
if ( ! defined( 'ABSPATH' ) ) { exit; }
/**
* Shortcode progress bars class.
*
*/
class DT_Shortcode_ProgressBars extends DT_Shortcode {
static protected $instance;
static protected $atts = array();
protected $plugin_name = 'dt_mce_plugin_shortcode_progress_bars';
public static function get_instance() {
if ( !self::$instance ) {
self::$instance = new DT_Shortcode_ProgressBars();
}
return self::$instance;
}
protected function __construct() {
add_shortcode( 'dt_progress_bars', array($this, 'shortcode_bars') );
add_shortcode( 'dt_progress_bar', array($this, 'shortcode_bar') );
}
public function shortcode_bars( $atts, $content = null ) {
$attributes = shortcode_atts( array(
'show_percentage' => '1',
), $atts, 'dt_progress_bars' );
$attributes['show_percentage'] = apply_filters('dt_sanitize_flag', $attributes['show_percentage']);
$atts_backup = self::$atts;
self::$atts = $attributes;
$output = sprintf( '<div class="skills animate-element">%s</div>', do_shortcode($content) );
self::$atts = $atts_backup;
return $output;
}
public function shortcode_bar( $atts, $content = null ) {
$shortcode_atts = shortcode_atts( [
'title' => '',
'color' => '',
'percentage' => ''
], $atts, 'dt_progress_bar' );
extract( $shortcode_atts );
$title = wp_kses($title, array());
$color = esc_attr($color);
$percentage = absint($percentage);
$percentage = $percentage > 100 ? 100 : $percentage;
$show_percentage = true;
if ( !empty(self::$atts) ) {
$show_percentage = self::$atts['show_percentage'];
}
$output = sprintf( '<div class="skill-name">%1$s%4$s</div><div class="skill"><div class="skill-value" data-width="%2$s"%3$s></div></div>',
$title,
$percentage,
$color ? ' style="background-color: ' . $color . '"' : '',
$show_percentage ? ' <span>' . $percentage . '%</span>' : ''
);
return $output;
}
}
// create shortcode
DT_Shortcode_ProgressBars::get_instance();