| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
* Plugin Name: MetaSlider Gallery |
| 5 |
* Plugin URI: https://www.metaslider.com |
| 6 |
* Description: MetaSlider Gallery is the image gallery plugin for WordPress. Create a beautiful display for your photos with carousel, masonry, grid, and more views. |
| 7 |
* Version: 2.37.0 |
| 8 |
* Requires PHP: 7.0 |
| 9 |
* Author: MetaSlider |
| 10 |
* Author URI: https://www.metaslider.com |
| 11 |
* License: GPL-2.0+ |
| 12 |
* Copyright: 2020+ MetaSlider |
| 13 |
* |
| 14 |
* Text Domain: ml-slider-lightbox |
| 15 |
* Domain Path: /languages |
| 16 |
*/ |
| 17 |
if (! defined('ABSPATH')) { |
| 18 |
die('No direct access.'); |
| 19 |
} |
| 20 |
|
| 21 |
if (! defined('ML_SLIDER_LIGHTBOX_PATH')) { |
| 22 |
define('ML_SLIDER_LIGHTBOX_PATH', plugin_dir_path(__FILE__)); |
| 23 |
} |
| 24 |
if (! defined('ML_SLIDER_LIGHTBOX_URL')) { |
| 25 |
define('ML_SLIDER_LIGHTBOX_URL', plugin_dir_url(__FILE__)); |
| 26 |
} |
| 27 |
|
| 28 |
if (! class_exists('MetaSlider\Lightbox\MetaSliderLightboxPlugin')) { |
| 29 |
require_once plugin_dir_path(__FILE__) . 'class-ml-trigger-control.php'; |
| 30 |
require_once plugin_dir_path(__FILE__) . 'class-ml-gallery-image-size.php'; |
| 31 |
require_once plugin_dir_path(__FILE__) . 'class-ml-slider-lightbox.php'; |
| 32 |
add_action('plugins_loaded', array(MetaSlider\Lightbox\MetaSliderLightboxPlugin::getInstance(), 'setup'), 10); |
| 33 |
|
| 34 |
register_activation_hook(__FILE__, 'metaslider_lightbox_activation'); |
| 35 |
} |
| 36 |
|
| 37 |
/** |
| 38 |
* Plugin activation hook |
| 39 |
* Sets transients to redirect to the gallery list page and show the |
| 40 |
* one-time welcome banner there. The welcome transient is consumed on |
| 41 |
* first render, so the banner appears exactly once. |
| 42 |
*/ |
| 43 |
function metaslider_lightbox_activation() |
| 44 |
{ |
| 45 |
set_transient('metaslider_lightbox_activation_redirect', true, 30); |
| 46 |
set_transient('metaslider_lightbox_welcome', true, MINUTE_IN_SECONDS); |
| 47 |
} |
| 48 |
|