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/list/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

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

if ( ! class_exists( 'DT_Shortcode_List', false ) ) {

	class DT_Shortcode_List extends DT_Shortcode {

		static protected $instance;
		static protected $atts = array();

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

		protected function __construct() {
			add_shortcode( 'dt_list_item', array( $this, 'shortcode_item' ) );
			add_shortcode( 'dt_list', array( $this, 'shortcode_list' ) );
		}

		public function shortcode_list( $atts, $content = null ) {
			$shortcode_atts = shortcode_atts( [
				'style'           => '1',
				'dividers'        => '1',
				'bullet_position' => 'middle',
				'start'           => '1'
			], $atts, 'dt_list' );
			extract( $shortcode_atts );

			$style = in_array( $style, array('1', '2', '3') ) ? $style : '1';
			$bullet_position = in_array( $bullet_position, array('top', 'middle') ) ? $bullet_position : 'middle';
			$dividers = apply_filters('dt_sanitize_flag', $dividers);
			$start = intval($start);

			$classes = array();
			$tag = 'ul';
			$attributes = '';

			switch ( $style ) {
				case '2':
					$classes[] = 'standard-number-list';
					$tag = 'ol';
					$attributes .= ' style="counter-reset: my-badass-counter ' . ($start - 1) . ';"';
					break;
				case '3':
					$classes[] = 'image-arrow';
					break;
				default:
					$classes[] = 'standard-arrow';
			}

			if ( $dividers ) {
				$classes[] = 'list-divider';
			}

			if ( 'top' == $bullet_position ) {
				$classes[] = 'bullet-top';
			}

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

			// store atts
			$atts_backup = self::$atts;

			// change atts
			self::$atts = array(
				'style'     => $style,
				'dividers'  => $dividers
			);

			$output = sprintf( '<%1$s%4$s class="%2$s">%3$s</%1$s>', $tag, esc_attr($classes), presscore_remove_wpautop( $content, false ), $attributes );

			// restore atts
			self::$atts = $atts_backup;

			return $output;
		}

		public function shortcode_item( $atts, $content = null ) {
			$shortcode_atts = shortcode_atts( [
				'image' => '',
			], $atts, 'dt_list_item' );
			extract( $shortcode_atts );

			$image = esc_url( $image );

			if ( isset( self::$atts['style'] ) && '3' == self::$atts['style'] ) {

				$content = '<div>' . $content . '</div>';

				if ( $image ) {
					$content = sprintf( '<div><img src="%s" class="list-img" alt="%s" /></div>%s', $image, esc_attr( __( 'List item image', 'the7mk2' ) ), $content );
				}

				$content = '<div class="wf-table">' . $content . '</div>';
			}

			$output = sprintf( '<li>%s</li>', presscore_remove_wpautop( $content, true ) );

			return $output;
		}

	}

	// create shortcode
	DT_Shortcode_List::get_instance();

}

Spamworldpro Mini