Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/www/wp-content/themes/dt-the7/inc/shortcodes/includes/highlight/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/www/wp-content/themes/dt-the7/inc/shortcodes/includes/highlight/highlight.php
<?php
/**
 * Highlight shortcode.
 *
 */

// File Security Check
if ( ! defined( 'ABSPATH' ) ) { exit; }

/**
 * Shortcode highlight class.
 *
 */
class DT_Shortcode_Highlight extends DT_Shortcode {

    static protected $instance;

    protected $plugin_name = 'dt_mce_plugin_shortcode_highlight';

    public static function get_instance() {
        if ( !self::$instance ) {
            self::$instance = new DT_Shortcode_Highlight();
        }
        return self::$instance;
    }

    protected function __construct() {
        add_shortcode( 'dt_highlight', array($this, 'shortcode') );
    }

    public function shortcode( $atts, $content = null ) {
		$shortcode_atts = shortcode_atts( [
			'color'      => '',
			'text_color' => '',
			'bg_color'   => ''
		], $atts, 'dt_highlight' );
		extract( $shortcode_atts );

		$button_colors = array(
            'white',
            'red',
            'berry',
            'orange',
            'yellow',
            'pink',
            'green',
            'dark_green',
            'blue',
            'dark_blue',
            'violet',
            'black',
            'gray',
            'grey'
        );
        $color = in_array($color, $button_colors) ? $color : '';
        $text_color = ( $text_color ? of_sanitize_color( $text_color ) : '' );
        $bg_color = ( $bg_color ? of_sanitize_color( $bg_color ) : '' );

        $classes = array('dt-highlight');

        if ( $color ) {
            $color = ('grey' == $color) ? 'gray' : $color;
            $classes[] = 'highlight-' . str_replace('_', '-', $color );
        }

        $classes = implode( ' ', $classes );

        $style = '';
        $style_parts = array();
        if ( $text_color ) {
            $style_parts[] = "color: {$text_color};";
        }

        if ( $bg_color ) {
            $style_parts[] = "background: {$bg_color} !important;";
        }

        if ( $style_parts ) {
            $style = 'style="' . esc_attr( implode( ' ', $style_parts ) ) . '"';
        }

        $output = sprintf( '<span class="%s" %s>%s</span>',
            esc_attr( $classes ),
            $style,
            $content
        );

        return $output;
    }

}

// create shortcode
DT_Shortcode_Highlight::get_instance();

Spamworldpro Mini