| Server IP : 60.247.133.247 / Your IP : 216.73.217.108 Web Server : Apache System : Linux ebs-119054 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64 User : goodwill ( 65985) PHP Version : 8.2.20 Disable Function : link,symlink,passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server,pcntl_fork,pcntl_rfork MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/wwwroot/goodwill/wwwroot/wp-content/themes/GoodWill/inc/shortcodes/includes/quote/ |
Upload File : |
<?php
/**
* Quote shortcode.
*
*/
// File Security Check
if ( ! defined( 'ABSPATH' ) ) { exit; }
if ( ! class_exists( 'DT_Shortcode_Quote', false ) ) {
class DT_Shortcode_Quote extends DT_Shortcode {
static protected $instance;
public static function get_instance() {
if ( !self::$instance ) {
self::$instance = new DT_Shortcode_Quote();
}
return self::$instance;
}
protected function __construct() {
add_shortcode( 'dt_quote', array( $this, 'shortcode' ) );
}
public function shortcode( $atts, $content = null ) {
$default_atts = array(
'type' => 'blockquote',
'layout' => 'left',
'font_size' => 'big',
'size' => '1',
'animation' => 'none',
'background' => 'plain'
);
$shortcode_atts = shortcode_atts( $default_atts, $atts, 'dt_quote' );
extract( $shortcode_atts );
$font_size = sanitize_key( $font_size );
$type = sanitize_key( $type );
$layout = sanitize_key( $layout );
$size = sanitize_key( $size );
$background = sanitize_key( $background );
$classes = array();
$classes[] = presscore_get_font_size_class( $font_size );
if ( presscore_shortcode_animation_on( $animation ) ) {
$classes[] = presscore_get_shortcode_animation_html_class( $animation );
}
if ( 'blockquote' !== $type ) {
$tag = 'q';
$classes[] = 'shortcode-pullquote';
$classes[] = 'wf-cell';
if ( 'right' === $layout ) {
$classes[] = 'align-right';
} else {
$classes[] = 'align-left';
}
switch ( $size ) {
case '2': $classes[] = 'wf-1-2'; break;
case '3': $classes[] = 'wf-1-3'; break;
case '4': $classes[] = 'wf-1-4'; break;
default: $classes[] = 'wf-1';
}
} else {
$tag = 'blockquote';
$classes[] = 'shortcode-blockquote';
if ( 'fancy' === $background ) {
$classes[] = 'block-style-widget';
}
}
return sprintf( '<%1$s class="%2$s">%3$s</%1$s>',
$tag,
esc_attr( implode( ' ', $classes ) ),
/**
* @see sanitize-functions.php
*/
presscore_remove_wpautop( $content, true )
);
}
}
// create shortcode
DT_Shortcode_Quote::get_instance();
}