PluginProbe ʕ •ᴥ•ʔ
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More / 4.0.0
Superb Addons: Blocks, Patterns, Pre-built Pages, Sliders, Popups, Free Forms, Animations & More v4.0.0
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 4.0.0 trunk 1.0.0 2.0.0 2.0.1 2.0.2 2.0.3 3.0 3.0.1 3.0.2 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.2 3.1.3 3.2.0 3.2.1 3.2.2 3.2.4 3.2.5 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.4.5 3.4.6 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.6 3.5.7 3.5.8 3.5.9 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1
superb-blocks / src / components / slots / class-premium-option-wrapper.php
superb-blocks / src / components / slots Last commit date
class-css-blocks-base-slot.php 2 months ago class-css-blocks-export-selected-slot.php 2 months ago class-css-blocks-export-single-slot.php 2 months ago class-css-blocks-target-slot.php 2 months ago class-premium-option-wrapper.php 2 months ago class-premium-slot.php 2 months ago class-slot-render-utility.php 2 months ago
class-premium-option-wrapper.php
40 lines
1 <?php
2
3 namespace SuperbAddons\Components\Slots;
4
5 use SuperbAddons\Admin\Utils\AdminLinkUtil;
6
7 defined('ABSPATH') || exit();
8
9 class PremiumOptionWrapper
10 {
11 public function __construct($contentCallback, $classes = array(), $source = false, $link_options = false, $allow_pointer_events = false)
12 {
13 $this->Render($contentCallback, $classes, $source, $link_options, $allow_pointer_events);
14 }
15
16 private function Render($contentCallback, $classes, $source, $link_options, $allow_pointer_events)
17 {
18 // data-superb-upsell-source lives on the wrapper (not the inner <a>) so
19 // clicks anywhere inside — including from inner content that has its
20 // own pointer events — bubble up and open the upsell modal. The badge
21 // anchor is the graceful no-JS / middle-click target. Children that
22 // need their own click behavior (e.g. .sba-wizard-preview-btn) just
23 // stopPropagation and the document delegation never fires.
24 $passthrough_class = $allow_pointer_events ? ' superbaddons-premium-only-option-wrapper-passthrough' : '';
25 ?>
26 <div class="superbaddons-element-inlineflex-center superbaddons-premium-only-option-wrapper<?php echo esc_attr($passthrough_class); ?> <?php echo esc_attr(join(" ", $classes)); ?>"<?php echo $source ? ' data-superb-upsell-source="' . esc_attr($source) . '"' : ''; ?> title="<?php echo esc_attr__("Premium Feature", "superb-blocks"); ?>">
27 <a href="<?php echo esc_url(AdminLinkUtil::GetLink($source, $link_options)); ?>" target="_blank" class="superbaddons-premium-only-option" aria-label="<?php echo esc_attr__("Premium Feature", "superb-blocks"); ?>">
28 <div class="superbaddons-premium-only-option-icon">
29 <img width="16" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/color-crown.svg'); ?>" />
30 <span><?php echo esc_html__("Premium", "superb-blocks"); ?></span>
31 </div>
32 </a>
33 <div class="superbaddons-premium-only-content" style="<?php echo $allow_pointer_events ? '' : 'pointer-events: none;'; ?> opacity:0.5;">
34 <?php SlotRenderUtility::Render($contentCallback); ?>
35 </div>
36 </div>
37 <?php
38 }
39 }
40