| 1 |
<?php |
| 2 |
/** |
| 3 |
* Custom Code Manager - List Page Template |
| 4 |
* |
| 5 |
* @package King_Addons |
| 6 |
*/ |
| 7 |
|
| 8 |
defined('ABSPATH') || exit; |
| 9 |
|
| 10 |
use King_Addons\Custom_Code_Manager; |
| 11 |
|
| 12 |
/** @var array $snippets */ |
| 13 |
/** @var int $snippet_count */ |
| 14 |
/** @var bool $has_pro */ |
| 15 |
/** @var bool $at_limit */ |
| 16 |
?> |
| 17 |
<div class="kng-cc-admin"> |
| 18 |
<!-- Header --> |
| 19 |
<header class="kng-cc-header"> |
| 20 |
<div class="kng-cc-header-left"> |
| 21 |
<div class="kng-cc-header-icon"> |
| 22 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="32" height="32"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg> |
| 23 |
</div> |
| 24 |
<div> |
| 25 |
<h1 class="kng-cc-title"> |
| 26 |
<?php esc_html_e('Custom Code', 'king-addons'); ?> |
| 27 |
</h1> |
| 28 |
<p class="kng-cc-subtitle"><?php esc_html_e('Add custom CSS, JavaScript, and HTML snippets anywhere on your site.', 'king-addons'); ?></p> |
| 29 |
<p class="kng-cc-meta"> |
| 30 |
<?php if (!$has_pro): ?> |
| 31 |
<?php printf( |
| 32 |
/* translators: %1$d: current count, %2$d: max limit */ |
| 33 |
esc_html__('%1$d of %2$d snippets (Free)', 'king-addons'), |
| 34 |
$snippet_count, |
| 35 |
Custom_Code_Manager::FREE_LIMIT |
| 36 |
); ?> |
| 37 |
<?php else: ?> |
| 38 |
<?php printf( |
| 39 |
/* translators: %d: total count */ |
| 40 |
esc_html(_n('%d snippet', '%d snippets', $snippet_count, 'king-addons')), |
| 41 |
$snippet_count |
| 42 |
); ?> |
| 43 |
<?php endif; ?> |
| 44 |
</p> |
| 45 |
</div> |
| 46 |
</div> |
| 47 |
<div class="kng-cc-header-right"> |
| 48 |
<div class="ka-v3-segmented" id="ka-v3-theme-segment" role="radiogroup" aria-label="<?php echo esc_attr(esc_html__('Theme', 'king-addons')); ?>" data-active="<?php echo esc_attr($theme_mode); ?>"> |
| 49 |
<span class="ka-v3-segmented-indicator" aria-hidden="true"></span> |
| 50 |
<button type="button" class="ka-v3-segmented-btn" data-theme="light" aria-pressed="<?php echo $theme_mode === 'light' ? 'true' : 'false'; ?>"> |
| 51 |
<span class="ka-v3-segmented-icon" aria-hidden="true">☀︎</span> |
| 52 |
<?php esc_html_e('Light', 'king-addons'); ?> |
| 53 |
</button> |
| 54 |
<button type="button" class="ka-v3-segmented-btn" data-theme="dark" aria-pressed="<?php echo $theme_mode === 'dark' ? 'true' : 'false'; ?>"> |
| 55 |
<span class="ka-v3-segmented-icon" aria-hidden="true">☾</span> |
| 56 |
<?php esc_html_e('Dark', 'king-addons'); ?> |
| 57 |
</button> |
| 58 |
<button type="button" class="ka-v3-segmented-btn" data-theme="auto" aria-pressed="<?php echo $theme_mode === 'auto' ? 'true' : 'false'; ?>"> |
| 59 |
<span class="ka-v3-segmented-icon" aria-hidden="true">◐</span> |
| 60 |
<?php esc_html_e('Auto', 'king-addons'); ?> |
| 61 |
</button> |
| 62 |
</div> |
| 63 |
<a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-custom-code&view=import-export')); ?>" class="kng-v3-btn kng-v3-btn--ghost"> |
| 64 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"> |
| 65 |
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> |
| 66 |
<polyline points="17 8 12 3 7 8"/> |
| 67 |
<line x1="12" y1="3" x2="12" y2="15"/> |
| 68 |
</svg> |
| 69 |
<?php esc_html_e('Import / Export', 'king-addons'); ?> |
| 70 |
</a> |
| 71 |
<a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-custom-code&view=settings')); ?>" class="kng-v3-btn kng-v3-btn--ghost"> |
| 72 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"> |
| 73 |
<circle cx="12" cy="12" r="3"/> |
| 74 |
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/> |
| 75 |
</svg> |
| 76 |
<?php esc_html_e('Settings', 'king-addons'); ?> |
| 77 |
</a> |
| 78 |
<?php if ($at_limit): ?> |
| 79 |
<button type="button" class="kng-v3-btn kng-v3-btn--primary" id="kng-cc-add-new-limit"> |
| 80 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"> |
| 81 |
<line x1="12" y1="5" x2="12" y2="19"/> |
| 82 |
<line x1="5" y1="12" x2="19" y2="12"/> |
| 83 |
</svg> |
| 84 |
<?php esc_html_e('Add New', 'king-addons'); ?> |
| 85 |
</button> |
| 86 |
<?php else: ?> |
| 87 |
<a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-custom-code&view=new')); ?>" class="kng-v3-btn kng-v3-btn--primary"> |
| 88 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"> |
| 89 |
<line x1="12" y1="5" x2="12" y2="19"/> |
| 90 |
<line x1="5" y1="12" x2="19" y2="12"/> |
| 91 |
</svg> |
| 92 |
<?php esc_html_e('Add New', 'king-addons'); ?> |
| 93 |
</a> |
| 94 |
<?php endif; ?> |
| 95 |
</div> |
| 96 |
</header> |
| 97 |
|
| 98 |
<!-- Filters & Bulk Actions --> |
| 99 |
<div class="kng-cc-toolbar"> |
| 100 |
<div class="kng-cc-toolbar-left"> |
| 101 |
<div class="kng-cc-bulk-actions"> |
| 102 |
<label class="kng-cc-checkbox-wrap kng-cc-select-all-wrap"> |
| 103 |
<input type="checkbox" class="kng-cc-select-all" /> |
| 104 |
<span class="kng-cc-checkbox-custom"></span> |
| 105 |
</label> |
| 106 |
<select class="kng-cc-bulk-select kng-v3-select" id="kng-cc-bulk-action"> |
| 107 |
<option value=""><?php esc_html_e('Bulk Actions', 'king-addons'); ?></option> |
| 108 |
<option value="enable"><?php esc_html_e('Enable', 'king-addons'); ?></option> |
| 109 |
<option value="disable"><?php esc_html_e('Disable', 'king-addons'); ?></option> |
| 110 |
<option value="delete"><?php esc_html_e('Delete', 'king-addons'); ?></option> |
| 111 |
</select> |
| 112 |
<button type="button" class="kng-v3-btn kng-v3-btn--secondary kng-v3-btn--sm" id="kng-cc-bulk-apply"> |
| 113 |
<?php esc_html_e('Apply', 'king-addons'); ?> |
| 114 |
</button> |
| 115 |
</div> |
| 116 |
</div> |
| 117 |
<div class="kng-cc-toolbar-right"> |
| 118 |
<div class="kng-cc-filters"> |
| 119 |
<select class="kng-v3-select kng-cc-filter" data-filter="type"> |
| 120 |
<option value=""><?php esc_html_e('All Types', 'king-addons'); ?></option> |
| 121 |
<option value="css">CSS</option> |
| 122 |
<option value="js">JavaScript</option> |
| 123 |
<?php if ($has_pro): ?> |
| 124 |
<option value="html">HTML</option> |
| 125 |
<?php endif; ?> |
| 126 |
</select> |
| 127 |
<select class="kng-v3-select kng-cc-filter" data-filter="status"> |
| 128 |
<option value=""><?php esc_html_e('All Status', 'king-addons'); ?></option> |
| 129 |
<option value="enabled"><?php esc_html_e('Enabled', 'king-addons'); ?></option> |
| 130 |
<option value="disabled"><?php esc_html_e('Disabled', 'king-addons'); ?></option> |
| 131 |
</select> |
| 132 |
<select class="kng-v3-select kng-cc-filter" data-filter="location"> |
| 133 |
<option value=""><?php esc_html_e('All Locations', 'king-addons'); ?></option> |
| 134 |
<option value="head"><?php esc_html_e('Head', 'king-addons'); ?></option> |
| 135 |
<option value="footer"><?php esc_html_e('Footer', 'king-addons'); ?></option> |
| 136 |
<?php if ($has_pro): ?> |
| 137 |
<option value="body_open"><?php esc_html_e('Body Open', 'king-addons'); ?></option> |
| 138 |
<option value="custom_hook"><?php esc_html_e('Custom Hook', 'king-addons'); ?></option> |
| 139 |
<?php endif; ?> |
| 140 |
</select> |
| 141 |
</div> |
| 142 |
<div class="kng-cc-search"> |
| 143 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"> |
| 144 |
<circle cx="11" cy="11" r="8"/> |
| 145 |
<line x1="21" y1="21" x2="16.65" y2="16.65"/> |
| 146 |
</svg> |
| 147 |
<input type="text" class="kng-v3-input" placeholder="<?php esc_attr_e('Search snippets...', 'king-addons'); ?>" id="kng-cc-search" /> |
| 148 |
</div> |
| 149 |
</div> |
| 150 |
</div> |
| 151 |
|
| 152 |
<!-- Snippets List --> |
| 153 |
<div class="kng-cc-list"> |
| 154 |
<?php if (empty($snippets)): ?> |
| 155 |
<div class="kng-cc-empty"> |
| 156 |
<div class="kng-cc-empty-icon"> |
| 157 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" width="40" height="40"> |
| 158 |
<polyline points="16 18 22 12 16 6"/> |
| 159 |
<polyline points="8 6 2 12 8 18"/> |
| 160 |
</svg> |
| 161 |
</div> |
| 162 |
<h3><?php esc_html_e('No snippets yet', 'king-addons'); ?></h3> |
| 163 |
<p><?php esc_html_e('Create your first custom code snippet to add CSS, JavaScript, or HTML to your site.', 'king-addons'); ?></p> |
| 164 |
<a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-custom-code&view=new')); ?>" class="kng-v3-btn kng-v3-btn--primary"> |
| 165 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"> |
| 166 |
<line x1="12" y1="5" x2="12" y2="19"/> |
| 167 |
<line x1="5" y1="12" x2="19" y2="12"/> |
| 168 |
</svg> |
| 169 |
<?php esc_html_e('Create First Snippet', 'king-addons'); ?> |
| 170 |
</a> |
| 171 |
</div> |
| 172 |
<?php else: ?> |
| 173 |
<div class="kng-cc-table-wrap"> |
| 174 |
<table class="kng-cc-table"> |
| 175 |
<thead> |
| 176 |
<tr> |
| 177 |
<th class="kng-cc-col-check"></th> |
| 178 |
<th class="kng-cc-col-name"><?php esc_html_e('Name', 'king-addons'); ?></th> |
| 179 |
<th class="kng-cc-col-type"><?php esc_html_e('Type', 'king-addons'); ?></th> |
| 180 |
<th class="kng-cc-col-location"><?php esc_html_e('Location', 'king-addons'); ?></th> |
| 181 |
<th class="kng-cc-col-scope"><?php esc_html_e('Scope', 'king-addons'); ?></th> |
| 182 |
<th class="kng-cc-col-priority"><?php esc_html_e('Priority', 'king-addons'); ?></th> |
| 183 |
<th class="kng-cc-col-status"><?php esc_html_e('Status', 'king-addons'); ?></th> |
| 184 |
<th class="kng-cc-col-modified"><?php esc_html_e('Modified', 'king-addons'); ?></th> |
| 185 |
<th class="kng-cc-col-actions"><?php esc_html_e('Actions', 'king-addons'); ?></th> |
| 186 |
</tr> |
| 187 |
</thead> |
| 188 |
<tbody id="kng-cc-snippets-list"> |
| 189 |
<?php foreach ($snippets as $snippet): ?> |
| 190 |
<tr class="kng-cc-row" |
| 191 |
data-id="<?php echo esc_attr($snippet['id']); ?>" |
| 192 |
data-type="<?php echo esc_attr($snippet['type']); ?>" |
| 193 |
data-status="<?php echo esc_attr($snippet['status']); ?>" |
| 194 |
data-location="<?php echo esc_attr($snippet['location']); ?>"> |
| 195 |
<td class="kng-cc-col-check"> |
| 196 |
<label class="kng-cc-checkbox-wrap"> |
| 197 |
<input type="checkbox" class="kng-cc-row-check" value="<?php echo esc_attr($snippet['id']); ?>" /> |
| 198 |
<span class="kng-cc-checkbox-custom"></span> |
| 199 |
</label> |
| 200 |
</td> |
| 201 |
<td class="kng-cc-col-name"> |
| 202 |
<a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-custom-code&view=edit&id=' . $snippet['id'])); ?>" class="kng-cc-name-link"> |
| 203 |
<?php echo esc_html($snippet['title'] ?: __('(no title)', 'king-addons')); ?> |
| 204 |
</a> |
| 205 |
<?php if (!empty($snippet['notes'])): ?> |
| 206 |
<span class="kng-cc-has-notes" title="<?php echo esc_attr($snippet['notes']); ?>"> |
| 207 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14"> |
| 208 |
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/> |
| 209 |
<polyline points="14 2 14 8 20 8"/> |
| 210 |
<line x1="16" y1="13" x2="8" y2="13"/> |
| 211 |
<line x1="16" y1="17" x2="8" y2="17"/> |
| 212 |
</svg> |
| 213 |
</span> |
| 214 |
<?php endif; ?> |
| 215 |
</td> |
| 216 |
<td class="kng-cc-col-type"> |
| 217 |
<span class="kng-cc-type-badge kng-cc-type-<?php echo esc_attr($snippet['type']); ?>"> |
| 218 |
<?php echo esc_html(strtoupper($snippet['type'])); ?> |
| 219 |
</span> |
| 220 |
</td> |
| 221 |
<td class="kng-cc-col-location"> |
| 222 |
<span class="kng-cc-location-badge"> |
| 223 |
<?php |
| 224 |
$locations = [ |
| 225 |
'head' => __('Head', 'king-addons'), |
| 226 |
'footer' => __('Footer', 'king-addons'), |
| 227 |
'body_open' => __('Body Open', 'king-addons'), |
| 228 |
'custom_hook' => $snippet['custom_hook'] ?: __('Custom Hook', 'king-addons'), |
| 229 |
]; |
| 230 |
echo esc_html($locations[$snippet['location']] ?? $snippet['location']); |
| 231 |
?> |
| 232 |
</span> |
| 233 |
</td> |
| 234 |
<td class="kng-cc-col-scope"> |
| 235 |
<span class="kng-cc-scope-badge kng-cc-scope-<?php echo esc_attr($snippet['scope_mode']); ?>"> |
| 236 |
<?php |
| 237 |
$scopes = [ |
| 238 |
'global' => __('Global', 'king-addons'), |
| 239 |
'include' => __('Include', 'king-addons'), |
| 240 |
'exclude' => __('Exclude', 'king-addons'), |
| 241 |
]; |
| 242 |
echo esc_html($scopes[$snippet['scope_mode']] ?? $snippet['scope_mode']); |
| 243 |
?> |
| 244 |
</span> |
| 245 |
<?php if (!empty($snippet['rules'])): ?> |
| 246 |
<span class="kng-cc-rules-count"><?php echo count($snippet['rules']); ?> <?php esc_html_e('rules', 'king-addons'); ?></span> |
| 247 |
<?php endif; ?> |
| 248 |
</td> |
| 249 |
<td class="kng-cc-col-priority"> |
| 250 |
<?php echo esc_html($snippet['priority']); ?> |
| 251 |
</td> |
| 252 |
<td class="kng-cc-col-status"> |
| 253 |
<label class="kng-v3-toggle-wrap"> |
| 254 |
<input type="checkbox" |
| 255 |
class="kng-cc-status-toggle" |
| 256 |
data-id="<?php echo esc_attr($snippet['id']); ?>" |
| 257 |
<?php checked($snippet['status'], 'enabled'); ?> /> |
| 258 |
<span class="kng-v3-toggle-slider"></span> |
| 259 |
</label> |
| 260 |
</td> |
| 261 |
<td class="kng-cc-col-modified"> |
| 262 |
<span class="kng-cc-date" title="<?php echo esc_attr($snippet['modified']); ?>"> |
| 263 |
<?php echo esc_html(human_time_diff(strtotime($snippet['modified'])) . ' ' . __('ago', 'king-addons')); ?> |
| 264 |
</span> |
| 265 |
</td> |
| 266 |
<td class="kng-cc-col-actions"> |
| 267 |
<div class="kng-cc-actions"> |
| 268 |
<a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-custom-code&view=edit&id=' . $snippet['id'])); ?>" |
| 269 |
class="kng-cc-action-btn kng-cc-action-btn--edit" |
| 270 |
title="<?php esc_attr_e('Edit', 'king-addons'); ?>"> |
| 271 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14"> |
| 272 |
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/> |
| 273 |
<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/> |
| 274 |
</svg> |
| 275 |
<?php esc_html_e('Edit', 'king-addons'); ?> |
| 276 |
</a> |
| 277 |
<button type="button" |
| 278 |
class="kng-cc-action-btn kng-cc-duplicate-btn" |
| 279 |
data-id="<?php echo esc_attr($snippet['id']); ?>" |
| 280 |
title="<?php esc_attr_e('Duplicate', 'king-addons'); ?>"> |
| 281 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16"> |
| 282 |
<rect x="9" y="9" width="13" height="13" rx="2"/> |
| 283 |
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/> |
| 284 |
</svg> |
| 285 |
</button> |
| 286 |
<button type="button" |
| 287 |
class="kng-cc-action-btn kng-cc-export-btn" |
| 288 |
data-id="<?php echo esc_attr($snippet['id']); ?>" |
| 289 |
title="<?php esc_attr_e('Export', 'king-addons'); ?>"> |
| 290 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16"> |
| 291 |
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> |
| 292 |
<polyline points="7 10 12 15 17 10"/> |
| 293 |
<line x1="12" y1="15" x2="12" y2="3"/> |
| 294 |
</svg> |
| 295 |
</button> |
| 296 |
<button type="button" |
| 297 |
class="kng-cc-action-btn kng-cc-action-btn--danger kng-cc-delete-btn" |
| 298 |
data-id="<?php echo esc_attr($snippet['id']); ?>" |
| 299 |
title="<?php esc_attr_e('Delete', 'king-addons'); ?>"> |
| 300 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16"> |
| 301 |
<polyline points="3 6 5 6 21 6"/> |
| 302 |
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/> |
| 303 |
<line x1="10" y1="11" x2="10" y2="17"/> |
| 304 |
<line x1="14" y1="11" x2="14" y2="17"/> |
| 305 |
</svg> |
| 306 |
</button> |
| 307 |
</div> |
| 308 |
</td> |
| 309 |
</tr> |
| 310 |
<?php endforeach; ?> |
| 311 |
</tbody> |
| 312 |
</table> |
| 313 |
</div> |
| 314 |
<?php endif; ?> |
| 315 |
</div> |
| 316 |
|
| 317 |
<?php if (!$has_pro): ?> |
| 318 |
<!-- Pro Upsell --> |
| 319 |
<div class="kng-cc-pro-upsell"> |
| 320 |
<div class="kng-cc-pro-upsell-content"> |
| 321 |
<div class="kng-cc-pro-upsell-icon"> |
| 322 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" width="32" height="32"> |
| 323 |
<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/> |
| 324 |
</svg> |
| 325 |
</div> |
| 326 |
<div class="kng-cc-pro-upsell-text"> |
| 327 |
<h4><?php esc_html_e('Unlock Pro Features', 'king-addons'); ?></h4> |
| 328 |
<p><?php esc_html_e('Get HTML snippets, unlimited code blocks, body open injection, custom hooks, advanced rules, and more.', 'king-addons'); ?></p> |
| 329 |
</div> |
| 330 |
<a href="https://kingaddons.com/pricing/?utm_source=kng-custom-code&utm_medium=wp-admin&utm_campaign=kng" target="_blank" rel="noopener" class="kng-v3-btn kng-v3-btn--accent"> |
| 331 |
<?php esc_html_e('Upgrade to Pro', 'king-addons'); ?> |
| 332 |
</a> |
| 333 |
</div> |
| 334 |
</div> |
| 335 |
<?php endif; ?> |
| 336 |
</div> |
| 337 |
|
| 338 |
<?php if (!$has_pro): ?> |
| 339 |
<!-- Pro Upgrade Popup --> |
| 340 |
<div class="kng-cc-pro-popup-overlay" id="kng-cc-pro-popup" style="display:none;"> |
| 341 |
<div class="kng-cc-pro-popup"> |
| 342 |
<button type="button" class="kng-cc-pro-popup-close" id="kng-cc-pro-popup-close">×</button> |
| 343 |
<div class="kng-cc-pro-popup-icon"> |
| 344 |
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" width="32" height="32"> |
| 345 |
<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/> |
| 346 |
</svg> |
| 347 |
</div> |
| 348 |
<h3><?php esc_html_e('Snippet Limit Reached', 'king-addons'); ?></h3> |
| 349 |
<p><?php |
| 350 |
printf( |
| 351 |
/* translators: %d: free limit number */ |
| 352 |
esc_html__('You\'ve reached the free limit of %d snippets. Upgrade to Pro for unlimited code snippets and advanced features.', 'king-addons'), |
| 353 |
Custom_Code_Manager::FREE_LIMIT |
| 354 |
); |
| 355 |
?></p> |
| 356 |
<div class="kng-cc-pro-popup-features"> |
| 357 |
<span>✓ <?php esc_html_e('Unlimited snippets', 'king-addons'); ?></span> |
| 358 |
<span>✓ <?php esc_html_e('HTML support', 'king-addons'); ?></span> |
| 359 |
<span>✓ <?php esc_html_e('Advanced targeting', 'king-addons'); ?></span> |
| 360 |
<span>✓ <?php esc_html_e('Custom hooks', 'king-addons'); ?></span> |
| 361 |
</div> |
| 362 |
<div class="kng-cc-pro-popup-actions"> |
| 363 |
<a href="https://kingaddons.com/pricing/?utm_source=kng-custom-code&utm_medium=wp-admin&utm_campaign=kng" target="_blank" rel="noopener" class="kng-v3-btn kng-v3-btn--accent"> |
| 364 |
<?php esc_html_e('Upgrade to Pro', 'king-addons'); ?> |
| 365 |
</a> |
| 366 |
<button type="button" class="kng-v3-btn kng-v3-btn--ghost kng-cc-pro-popup-dismiss"> |
| 367 |
<?php esc_html_e('Maybe Later', 'king-addons'); ?> |
| 368 |
</button> |
| 369 |
</div> |
| 370 |
</div> |
| 371 |
</div> |
| 372 |
<?php endif; ?> |
| 373 |
|