| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Photonic Gallery & Lightbox for Flickr, SmugMug & Others |
| 4 |
* Plugin URI: https://aquoid.com/plugins/photonic/ |
| 5 |
* Description: Extends the native gallery to support Flickr, SmugMug and Zenfolio. JS libraries like BaguetteBox, BigPicture, Gie Lightbox, LightGallery, PhotoSwipe, Spotlight, Swipebox, Fancybox, Magnific, Colorbox, PrettyPhoto, Image Lightbox, Featherlight and Lightcase are supported. Photos are displayed in vanilla grids of thumbnails, or more fancy slideshows, or justified or masonry or random mosaic layouts. The plugin also extends all layout options to a regular WP gallery. |
| 6 |
* Version: 3.25 |
| 7 |
* Requires at least: 6.2 |
| 8 |
* Requires PHP: 7.3 |
| 9 |
* Author: Sayontan Sinha |
| 10 |
* Author URI: https://mynethome.net/ |
| 11 |
* License: GPLv3 or later |
| 12 |
* License URI: https://www.gnu.org/licenses/gpl-3.0.html |
| 13 |
* Text Domain: photonic |
| 14 |
* |
| 15 |
* Copyright (c) 2011 - 2026 Sayontan Sinha. All rights reserved. |
| 16 |
* |
| 17 |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 19 |
*/ |
| 20 |
|
| 21 |
namespace Photonic_Plugin; |
| 22 |
|
| 23 |
use Photonic_Plugin\Core\Photonic; |
| 24 |
|
| 25 |
class Photonic_Plugin { |
| 26 |
public function __construct() { |
| 27 |
if (!defined('PHOTONIC_VERSION')) { |
| 28 |
define('PHOTONIC_VERSION', '3.25'); |
| 29 |
} |
| 30 |
|
| 31 |
define('PHOTONIC_PATH', __DIR__); |
| 32 |
|
| 33 |
if (!defined('PHOTONIC_URL')) { |
| 34 |
define('PHOTONIC_URL', plugin_dir_url(__FILE__)); |
| 35 |
} |
| 36 |
|
| 37 |
$photonic_wp_upload_dir = wp_upload_dir(); |
| 38 |
if (!defined('PHOTONIC_UPLOAD_DIR')) { |
| 39 |
define('PHOTONIC_UPLOAD_DIR', trailingslashit($photonic_wp_upload_dir['basedir']) . 'photonic'); |
| 40 |
} |
| 41 |
|
| 42 |
if (!defined('PHOTONIC_UPLOAD_URL')) { |
| 43 |
define('PHOTONIC_UPLOAD_URL', trailingslashit($photonic_wp_upload_dir['baseurl']) . 'photonic'); |
| 44 |
} |
| 45 |
|
| 46 |
require_once PHOTONIC_PATH . '/Core/Photonic.php'; |
| 47 |
} |
| 48 |
} |
| 49 |
|
| 50 |
new Photonic_Plugin(); |
| 51 |
|
| 52 |
add_action('admin_init', '\Photonic_Plugin\photonic_utilities_init'); |
| 53 |
add_action('init', '\Photonic_Plugin\photonic_init', 0); // Delaying the start from 10 to 100 so that CPTs can be picked up |
| 54 |
|
| 55 |
/** |
| 56 |
* Main plugin initiation |
| 57 |
*/ |
| 58 |
function photonic_init() { |
| 59 |
global $photonic; |
| 60 |
$photonic = new Photonic(); |
| 61 |
} |
| 62 |
|
| 63 |
/** |
| 64 |
* Loads up the utilities file |
| 65 |
*/ |
| 66 |
function photonic_utilities_init() { |
| 67 |
require_once PHOTONIC_PATH . '/Core/Utilities.php'; |
| 68 |
} |
| 69 |
|