| @@ -24,8 +24,9 @@ | ||
| 24 | 24 | * Menu, Assets and maybe redirect on plugin activation is initialized. |
| 25 | 25 | */ |
| 26 | 26 | public function __construct() { |
| 27 | 27 | add_action( 'admin_enqueue_scripts', [ $this, 'scripts' ] ); |
| 28 | + add_action( 'load-toplevel_page_templately', [ $this, 'before_scripts' ] ); | |
| 28 | 29 | add_action( 'admin_menu', [ $this, 'admin_menu' ] ); |
| 29 | 30 | |
| 30 | 31 | self::$cache_bank = CacheBank::get_instance(); |
| 31 | 32 | |
| @@ -88,8 +89,12 @@ | ||
| 88 | 89 | |
| 89 | 90 | register_post_type( 'templately_library', $args ); |
| 90 | 91 | } |
| 91 | 92 | |
| 93 | + public function before_scripts() { | |
| 94 | + header("x-frame-options: ALLOW-FROM *.templately.com"); | |
| 95 | + } | |
| 96 | + | |
| 92 | 97 | /** |
| 93 | 98 | * Enqueuing Assets |
| 94 | 99 | * |
| 95 | 100 | * @param string $hook |
| @@ -174,8 +179,11 @@ | ||
| 174 | 179 | * @var Elementor|Gutenberg $platform |
| 175 | 180 | */ |
| 176 | 181 | $platform = $this->platform( $_current_screen ); |
| 177 | 182 | |
| 183 | + $hide_buttons = get_option('templately-gutenberg-hide-buttons', 'no'); | |
| 184 | + $hide_buttons = $hide_buttons === 'yes' ? 'yes' : 'no'; | |
| 185 | + | |
| 178 | 186 | $templately = array_merge( [ |
| 179 | 187 | 'url' => home_url(), |
| 180 | 188 | 'site_url' => site_url(), |
| 181 | 189 | 'nonce' => wp_create_nonce( 'templately_nonce' ), |
| @@ -189,8 +197,9 @@ | ||
| 189 | 197 | 'construction' => templately()->assets->icon( 'icons/construction.gif' ), |
| 190 | 198 | 'profile' => templately()->assets->icon( 'icons/profile.svg' ), |
| 191 | 199 | 'warning' => templately()->assets->icon( 'icons/warning.png' ) |
| 192 | 200 | ], |
| 201 | + 'locale' => get_locale(), | |
| 193 | 202 | 'promo_image' => templately()->assets->icon( 'single-page-promo.png' ), |
| 194 | 203 | 'default_image' => templately()->assets->icon( 'clouds/cloud-item.svg' ), |
| 195 | 204 | 'not_found' => templately()->assets->icon( 'no-item-found.png' ), |
| 196 | 205 | 'no_items' => templately()->assets->icon( 'no-items.png' ), |
| @@ -205,8 +214,9 @@ | ||
| 205 | 214 | 'has_elementor' => rest_sanitize_boolean( is_plugin_active( 'elementor/elementor.php' ) ), |
| 206 | 215 | 'has_elementor_pro' => rest_sanitize_boolean( is_plugin_active( 'elementor-pro/elementor-pro.php' ) ), |
| 207 | 216 | 'theme' => $_current_screen == 'templately' ? 'light' : $platform->ui_theme(), |
| 208 | 217 | 'is_wp_support_gutenberg' => version_compare( get_bloginfo( 'version' ), '5.0.0', '>=' ), |
| 218 | + 'hide_buttons' => $hide_buttons, | |
| 209 | 219 | ], $templately ); |
| 210 | 220 | |
| 211 | 221 | templately()->assets->localize( $_localize_handle, 'templately', $templately ); |
| 212 | 222 | } |
| @@ -333,45 +343,51 @@ | ||
| 333 | 343 | 'thumbnail' => templately()->assets->icon( 'logos/logo-full.svg' ), |
| 334 | 344 | 'html' => $notice_text, |
| 335 | 345 | ]; |
| 336 | 346 | |
| 337 | - $notices->add( 'black_friday', $_black_friday, [ | |
| 338 | - 'start' => $notices->strtotime('+1 minute'), | |
| 339 | - 'recurrence' => false, | |
| 340 | - 'dismissible' => true, | |
| 341 | - 'refresh' => TEMPLATELY_VERSION, | |
| 342 | - "expire" => strtotime( '11:59:59pm 5nd December, 2024' ), | |
| 343 | - 'display_if' => !wp_is_mobile(), | |
| 344 | - 'screens' => [ | |
| 345 | - 'dashboard', | |
| 346 | - ], | |
| 347 | - ] ); | |
| 347 | + // $notices->add( 'black_friday', $_black_friday, [ | |
| 348 | + // 'start' => $notices->strtotime('+1 minute'), | |
| 349 | + // 'recurrence' => false, | |
| 350 | + // 'dismissible' => true, | |
| 351 | + // 'refresh' => TEMPLATELY_VERSION, | |
| 352 | + // "expire" => strtotime( '11:59:59pm 5nd December, 2024' ), | |
| 353 | + // 'display_if' => !wp_is_mobile(), | |
| 354 | + // 'screens' => [ | |
| 355 | + // 'dashboard', | |
| 356 | + // ], | |
| 357 | + // ] ); | |
| 348 | 358 | |
| 349 | - $halloween_text = sprintf( | |
| 350 | - '<p style="margin-top: 0; margin-bottom: 0px;"> 🎃 %s <strong>%s</strong> %s</p>', | |
| 351 | - __('Halloween Treats: Get Templately PRO', 'templately'), | |
| 352 | - __('up to 65% OFF', 'templately'), | |
| 353 | - __('& unlock 5000+ ready WordPress templates now.', 'templately') | |
| 359 | + $holiday_text = sprintf( | |
| 360 | + '<p style="margin-top: 0; margin-bottom: 0px;"> 🎁 %s <strong>%s</strong> %s</p>', | |
| 361 | + __('Get', 'templately'), | |
| 362 | + __('Templately PRO', 'templately'), | |
| 363 | + __('with up to 60% OFF & unlock 5500+ ready WordPress templates to power up web design in 2025.', 'templately') | |
| 354 | 364 | ); |
| 355 | 365 | |
| 356 | - $halloween_text .= sprintf( | |
| 366 | + $holiday_text .= "<div class='wpnotice-button-wrapper'>"; | |
| 367 | + $holiday_text .= sprintf( | |
| 357 | 368 | '<a class="button button-primary" target="_blank" href="%2$s">%1$s</a>', |
| 358 | - $crown . __('Upgrade to Pro', 'templately'), | |
| 369 | + $crown . __('GET PRO Lifetime Access', 'templately'), | |
| 359 | 370 | 'https://templately.com/#pricing' |
| 360 | 371 | ); |
| 372 | + $holiday_text .= sprintf( | |
| 373 | + '<button class="button button-link dismiss-btn" data-dismiss="true">%1$s</button>', | |
| 374 | + __('No, I’ll Pay Full Price Later', 'templately'), | |
| 375 | + ); | |
| 376 | + $holiday_text .= "</div>"; | |
| 361 | 377 | |
| 362 | 378 | |
| 363 | - $_halloween = [ | |
| 379 | + $_holiday = [ | |
| 364 | 380 | 'thumbnail' => templately()->assets->icon( 'logos/logo-full.svg' ), |
| 365 | - 'html' => $halloween_text, | |
| 381 | + 'html' => $holiday_text, | |
| 366 | 382 | ]; |
| 367 | 383 | |
| 368 | - $notices->add( 'halloween', $_halloween, [ | |
| 369 | - 'start' => $notices->strtotime('+1 minute'), | |
| 384 | + $notices->add( 'holiday', $_holiday, [ | |
| 385 | + 'start' => $notices->strtotime( '+0 minute' ), | |
| 370 | 386 | 'recurrence' => false, |
| 371 | 387 | 'dismissible' => true, |
| 372 | 388 | 'refresh' => TEMPLATELY_VERSION, |
| 373 | - "expire" => strtotime( '11:59:59pm 3nd November, 2024' ), | |
| 389 | + "expire" => strtotime( '11:59:59pm 10th January, 2025' ), | |
| 374 | 390 | 'display_if' => !wp_is_mobile(), |
| 375 | 391 | 'screens' => [ |
| 376 | 392 | 'dashboard', |
| 377 | 393 | ], |
| @@ -438,16 +454,16 @@ | ||
| 438 | 454 | public function header() { |
| 439 | 455 | Helper::views( 'header' ); |
| 440 | 456 | } |
| 441 | 457 | |
| 442 | - /** | |
| 443 | - * Handle links displayed below the plugin name in the WordPress Installed Plugins page. | |
| 444 | - * | |
| 445 | - * @return array | |
| 446 | - * @since 3.1.2 | |
| 447 | - * @static | |
| 448 | - * | |
| 449 | - */ | |
| 458 | + /** | |
| 459 | + * Handle links displayed below the plugin name in the WordPress Installed Plugins page. | |
| 460 | + * | |
| 461 | + * @return array | |
| 462 | + * @since 3.1.2 | |
| 463 | + * @static | |
| 464 | + * | |
| 465 | + */ | |
| 450 | 466 | public static function handleActionLinks($links, $file) |
| 451 | 467 | { |
| 452 | 468 | $settingsLink = '<a href="' . admin_url('admin.php?page=templately') . '" aria-label="' . __('Open settings page', |
| 453 | 469 | 'templately') . '">' . __('Templates Library', 'templately') . '</a>'; |