'30',
'direction' => 'left',
'pause_on_hover' => 'true',
'class' => '',
'id' => '',
], $atts, 'marqueex_slider');
$unique_id = 'marqueex-slider-' . uniqid();
$class = !empty($atts['class']) ? ' ' . esc_attr($atts['class']) : '';
$id = !empty($atts['id']) ? ' id="' . esc_attr($atts['id']) . '"' : '';
$output = sprintf(
'
%s
',
$id,
$class,
esc_attr($atts['speed']),
esc_attr($atts['direction']),
esc_attr($atts['pause_on_hover']),
do_shortcode($content)
);
return $output;
}
/**
* Render News Ticker Shortcode
*/
public function render_ticker_shortcode($atts, $content = null) {
$atts = shortcode_atts([
'speed' => '30',
'direction' => 'left',
'pause_on_hover' => 'true',
'label' => 'BREAKING',
'show_label' => 'true',
'class' => '',
'id' => '',
], $atts, 'marqueex_ticker');
$unique_id = 'marqueex-ticker-' . uniqid();
$class = !empty($atts['class']) ? ' ' . esc_attr($atts['class']) : '';
$id = !empty($atts['id']) ? ' id="' . esc_attr($atts['id']) . '"' : '';
$output = '';
if ($atts['show_label'] === 'true') {
$output .= sprintf(
'
%s
',
esc_html($atts['label'])
);
}
$output .= sprintf(
'
%s
',
$id,
$class,
esc_attr($atts['speed']),
esc_attr($atts['direction']),
esc_attr($atts['pause_on_hover']),
do_shortcode($content)
);
$output .= '
';
return $output;
}
/**
* Render Infinite Slider Shortcode
*/
public function render_infinite_shortcode($atts, $content = null) {
$atts = shortcode_atts([
'speed' => '30',
'direction' => 'left',
'pause_on_hover' => 'true',
'gap' => '20',
'class' => '',
'id' => '',
], $atts, 'marqueex_infinite');
$unique_id = 'marqueex-infinite-' . uniqid();
$class = !empty($atts['class']) ? ' ' . esc_attr($atts['class']) : '';
$id = !empty($atts['id']) ? ' id="' . esc_attr($atts['id']) . '"' : '';
$output = sprintf(
'%s
',
$id,
$class,
esc_attr($atts['speed']),
esc_attr($atts['direction']),
esc_attr($atts['pause_on_hover']),
esc_attr($atts['gap']),
do_shortcode($content)
);
return $output;
}
/**
* Add shortcode documentation to admin
*/
public function add_shortcode_documentation() {
$screen = get_current_screen();
// Only show on post edit screens
if (!$screen || !in_array($screen->base, ['post', 'post-new'])) {
return;
}
?>
[marqueex_slider speed="30" direction="left" pause_on_hover="true"]Your content here[/marqueex_slider]
[marqueex_ticker speed="30" direction="left" label="BREAKING" show_label="true"]Your news content here[/marqueex_ticker]
[marqueex_infinite speed="30" direction="left" gap="20"]Your slider content here[/marqueex_infinite]
- speed:
- direction:
- pause_on_hover:
- label:
- show_label:
- gap:
- class:
- id:
[
'shortcode' => '[marqueex_slider speed="30" direction="left"]Your marquee content here[/marqueex_slider]',
'description' => __('Basic marquee slider with customizable speed and direction.', 'marqueex'),
],
'ticker' => [
'shortcode' => '[marqueex_ticker label="BREAKING" show_label="true"]Breaking news content here[/marqueex_ticker]',
'description' => __('News ticker with optional label and customizable settings.', 'marqueex'),
],
'infinite' => [
'shortcode' => '[marqueex_infinite gap="20" pause_on_hover="true"]Slider item 1 | Slider item 2 | Slider item 3[/marqueex_infinite]',
'description' => __('Infinite slider with configurable gap and hover pause.', 'marqueex'),
],
];
}
/**
* Get integration status
*/
public function get_status() {
return [
'active' => true,
'shortcodes_registered' => true,
'shortcodes' => [
'marqueex_slider' => shortcode_exists('marqueex_slider'),
'marqueex_ticker' => shortcode_exists('marqueex_ticker'),
'marqueex_infinite' => shortcode_exists('marqueex_infinite'),
],
];
}
}