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/tabs/ |
Upload File : |
<?php
namespace MixtapeQode\Modules\Shortcodes\Tab;
use MixtapeQode\Modules\Shortcodes\Lib\ShortcodeInterface;
/**
* Class Tab
*/
class Tab implements ShortcodeInterface {
/**
* @var string
*/
private $base;
function __construct() {
$this->base = 'qodef_tab';
add_action('vc_before_init', array($this, 'vcMap'));
}
/**
* Returns base for shortcode
* @return string
*/
public function getBase() {
return $this->base;
}
public function vcMap() {
vc_map( array(
'name' => esc_html__('Tab', 'mixtapewp'),
'base' => $this->getBase(),
'as_parent' => array('except' => 'vc_row'),
'as_child' => array('only' => 'qodef_tabs'),
'is_container' => true,
'category' => esc_html__('by SELECT', 'mixtapewp'),
'icon' => 'icon-wpb-tab extended-custom-icon',
'show_settings_on_create' => true,
'js_view' => 'VcColumnView',
'params' => array_merge(
\MixtapeQodeIconCollections::get_instance()->getVCParamsArray(),
array(
array(
'type' => 'textfield',
'admin_label' => true,
'heading' => esc_html__('Title', 'mixtapewp'),
'param_name' => 'tab_title',
'description' => ''
)
)
)
));
}
public function render($atts, $content = null) {
$default_atts = array(
'tab_title' => esc_html__('Tab', 'mixtapewp'),
'tab_id' => ''
);
$default_atts = array_merge($default_atts, mixtape_qodef_icon_collections()->getShortcodeParams());
$params = shortcode_atts($default_atts, $atts);
extract($params);
$iconPackName = mixtape_qodef_icon_collections()->getIconCollectionParamNameByKey($params['icon_pack']);
$params['icon'] = $params[$iconPackName];
$rand_number = rand(0, 1000);
$params['tab_title'] = $params['tab_title'].'-'.$rand_number;
$params['content'] = $content;
$output = '';
$output .= qodef_core_get_shortcode_template_part('templates/tab-content','tabs', '', $params);
return $output;
}
}