Done !
| Server IP : 46.105.57.169 / Your IP : 216.73.216.67 Web Server : Apache System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaumee ( 152031) PHP Version : 8.5.7 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaumee/www/curators/wp-content/plugins/select-core/shortcodes/blockquote/ |
Upload File : |
<?php
namespace MixtapeQode\Modules\Shortcodes\Blockquote;
use MixtapeQode\Modules\Shortcodes\Lib\ShortcodeInterface;
/**
* Class Blockquote
*/
class Blockquote implements ShortcodeInterface {
/**
* @var string
*/
private $base;
public function __construct() {
$this->base = 'qodef_blockquote';
add_action('vc_before_init', array($this, 'vcMap'));
}
/**
* Returns base for shortcode
* @return string
*/
public function getBase() {
return $this->base;
}
/**
* Maps shortcode to Visual Composer. Hooked on vc_before_init
*
* @see qodef_core_get_carousel_slider_array_vc()
*/
public function vcMap() {
vc_map( array(
'name' => esc_html__('Blockquote', 'mixtapewp'),
'base' => $this->getBase(),
'category' => esc_html__('by SELECT', 'mixtapewp'),
'icon' => 'icon-wpb-blockquote extended-custom-icon',
'allowed_container_element' => 'vc_row',
'params' => array(
array(
"type" => "textarea",
"heading" => esc_html__('Text', 'mixtapewp'),
"param_name" => "text",
"value" => ""
),
array(
"type" => "textfield",
"heading" => esc_html__("Width (%)", 'mixtapewp'),
"param_name" => "width"
)
)
) );
}
/**
* Renders shortcodes HTML
*
* @param $atts array of shortcode params
* @return string
*/
public function render($atts, $content = null) {
$args = array(
'text' => '',
'width' => '',
);
$params = shortcode_atts($args, $atts);
$params['blockquote_style'] = $this->getBlockquoteStyle($params);
//Get HTML from template
$html = qodef_core_get_shortcode_template_part('templates/blockquote-template', 'blockquote', '', $params);
return $html;
}
/**
* Return Style for Blockquote
*
* @param $params
* @return string
*/
private function getBlockquoteStyle($params) {
$blockquote_style = array();
if ($params['width'] !== '') {
$width = strstr($params['width'], '%') ? $params['width'] : $params['width'].'%';
$blockquote_style[] = 'width: '.$width;
}
return implode(';', $blockquote_style);
}
}