PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 3.36
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v3.36
3.36 3.35 3.34 3.33 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.26 2.27 2.28 2.29 2.30 2.31 2.32 2.33 2.34 2.40 2.41 2.42 2.43 2.44 All 141 releases
← All changes | Options/Generic.php +474 -354 2.433.36 View file →
@@ -1,123 +1,179 @@
1 1 <?php
2 +
2 3 namespace Photonic_Plugin\Options;
4 +
3 5 use Photonic_Plugin\Core\Utilities;
4 6
5 7 class Generic extends Option_Tab {
6 - private static $instance;
7 -
8 - private function __construct() {
8 + protected function __construct() {
9 9 $this->options = [
10 - ['name' => "How To",
11 - 'desc' => "Control generic settings for the plugin",
10 + [
11 + 'name' => 'How To',
12 + 'desc' => 'Control generic settings for the plugin',
12 13 'category' => 'generic-how-to',
13 - 'buttons' => 'no-buttons',
14 - 'type' => 'section',],
14 + 'buttons' => 'no-buttons',
15 + 'type' => 'section',
16 + ],
15 17
16 - ['name' => "Creating a gallery",
17 - 'desc' => "Photonic lets you create a gallery via a <strong><em>Gutenberg Block</em></strong>:<br/><br/>
18 - <img src='".PHOTONIC_URL."screenshot-1.png' style='max-width: 300px;' alt='Gutenberg Block'/><br/><br/>
18 + [
19 + 'name' => 'Creating a gallery',
20 + 'desc' => "Photonic lets you create a gallery via a <strong><em>Gutenberg Block</em></strong>:<br/><br/>
21 + <img src='" . PHOTONIC_URL . "screenshot-1.png' style='max-width: 300px;' alt='Gutenberg Block'/><br/><br/>
19 22 Alternatively, if you are using the <strong><em>Classic Editor</em></strong> you can use the <em>Add / Edit Photonic Gallery</em> button:<br/><br/>
20 - <img src='".PHOTONIC_URL."screenshot-2.jpg' style='max-width: 300px;' alt='Add / Edit Button'/><br/><br/>
23 + <img src='" . PHOTONIC_URL . "screenshot-2.jpg' style='max-width: 300px;' alt='Add / Edit Button'/><br/><br/>
21 24 You will be presented with the following:<br/><br/>
22 - <img src='".PHOTONIC_URL."screenshot-3.png' style='max-width: 500px;' alt='Wizard' />",
25 + <img src='" . PHOTONIC_URL . "screenshot-3.png' style='max-width: 500px;' alt='Wizard' />",
23 26 'grouping' => 'generic-how-to',
24 - 'type' => 'blurb',],
27 + 'type' => 'blurb',
28 + ],
25 29
26 - ['name' => "Generic settings",
27 - 'desc' => "Control generic settings for the plugin",
30 + [
31 + 'name' => 'Generic settings',
32 + 'desc' => 'Control generic settings for the plugin',
28 33 'category' => 'generic-settings',
29 - 'type' => 'section',],
34 + 'type' => 'section',
35 + ],
30 36
31 - ['name' => "Custom Shortcode",
32 - 'desc' => "If you are using the <strong><em>Classic Editor</em></strong> by default Photonic uses the <code>gallery</code> shortcode,
37 + [
38 + 'name' => 'Custom Shortcode',
39 + 'desc' => 'If you are using the <strong><em>Classic Editor</em></strong> by default Photonic uses the <code>gallery</code> shortcode,
33 40 so that your galleries stay safe if you stop using Photonic.
34 41 But your theme or other plugins might be using the same shortcode too. In such a case define an explicit shortcode,
35 - and only this shortcode will show Photonic galleries",
36 - 'id' => "alternative_shortcode",
42 + and only this shortcode will show Photonic galleries',
43 + 'id' => 'alternative_shortcode',
37 44 'grouping' => 'generic-settings',
38 - 'type' => 'text'],
45 + 'type' => 'text'
46 + ],
39 47
40 - ['name' => "Inbuilt Lightbox libraries",
41 - 'desc' => "Photonic lets you choose from the following JS libraries for Lightbox effects:",
42 - 'id' => "slideshow_library",
48 + [
49 + 'name' => "Inbuilt Lightbox libraries",
50 + 'desc' => "Photonic lets you choose from the following JS libraries for Lightbox effects:",
51 + 'id' => 'slideshow_library',
43 52 'grouping' => 'generic-settings',
44 - 'type' => 'radio',
45 - 'options' => [
46 - "colorbox" => "<a href='http://colorpowered.com/colorbox/'>Colorbox</a> &ndash; ~10KB JS, ~5KB CSS: Released under the MIT license.",
47 - "fancybox" => "<a href='http://fancybox.net/'>FancyBox</a> &ndash; ~16KB JS, ~9KB CSS: Released under MIT and GPL licenses.",
48 - "fancybox3" => "<a href='https://fancyapps.com/fancybox/3/'>FancyBox 3</a> &ndash; ~61KB JS, ~14KB CSS: Released under the GPL v3 license.",
49 - "featherlight" => "<a href='http://noelboss.github.io/featherlight/'>Featherlight</a> &ndash; ~12KB JS, ~4KB CSS: Released under the MIT license.",
50 -// "fluidbox" => "<a href='https://terrymun.github.io/Fluidbox/'>Fluidbox</a> &ndash; ~10KB JS, ~4KB CSS: Released under the MIT license.",
51 -// "galleria" => "<a href='https://galleria.io/'>Galleria</a> &ndash; ~72KB JS (+ Theme), ~5KB CSS: Released under the MIT license.",
52 - "imagelightbox" => "<a href='https://osvaldas.info/image-lightbox-responsive-touch-friendly'>Image Lightbox</a> &ndash; ~6KB JS, ~5KB CSS: Released under the MIT license. No video support.",
53 - "lightcase" => "<a href='http://cornel.bopp-art.com/lightcase/'>LightCase</a> &ndash; ~25KB JS, ~16KB CSS: Released under the GPL license.",
54 - "lightgallery" => "<a href='https://sachinchoolur.github.io/lightGallery/'>Lightgallery</a> &ndash; ~18KB JS (+ Optional plugins), ~20KB CSS, ~20KB fonts: Released under the GPL v3 license.",
55 - "magnific" => "<a href='http://dimsemenov.com/plugins/magnific-popup/'>Magnific Popup</a> &ndash; ~20KB JS, ~7KB CSS: Released under the MIT license.",
56 - "photoswipe" => "<a href='http://photoswipe.com/'>PhotoSwipe</a> &ndash; ~42KB JS, ~4KB CSS: Released under the MIT license. No video support for Flickr.",
57 - "prettyphoto" => "<a href='http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/'>PrettyPhoto</a> &ndash; ~23KB JS, ~27KB CSS: Released under the GPL v2.0 license. YouTube and Vimeo supported, but no support for videos from Flickr etc.",
58 - "swipebox" => "<a href='http://brutaldesign.github.io/swipebox/'>Swipebox</a> &ndash; ~12KB, ~5KB CSS: Released under the MIT license.",
59 - "thickbox" => "Thickbox &ndash; ~12KB: Released under the MIT license. No video support.",
60 - "none" => "None",
61 - "custom" => "Non-bundled &nbsp; You have to provide the JS and CSS links. See <a href='https://aquoid.com/plugins/photonic/third-party-lightboxes/'>here</a> for instructions",
62 - ]],
53 + 'type' => 'radio-group',
54 + 'options' => [
55 + 'js' => [
56 + 'header' => 'Pure JavaScript Libraries',
57 + 'description' => "<p>These libraries are self-contained and don't require any additional dependencies. Many modern themes are moving away from jQuery, so if you have such a theme, one of these libraries is great for your site's speed.</p><br/>",
58 + 'options' => [
59 + 'baguettebox' => "<a href='https://feimosi.github.io/baguetteBox.js/'>BaguetteBox</a> &ndash; ~10KB JS, ~4KB CSS: Released under the MIT license. No support for YouTube / Vimeo.",
60 + 'bigpicture' => "<a href='https://henrygd.me/bigpicture/'>BigPicture</a> &ndash; ~9KB JS, no CSS: Released under the MIT license. No support for videos within galleries.",
61 + 'glightbox' => "<a href='https://biati-digital.github.io/glightbox/'>\"Gie\" Lightbox (GLightbox)</a> &ndash; ~54KB JS, ~14KB CSS: Released under the MIT license.",
62 + 'lightgallery' => "<a href='https://www.lightgalleryjs.com/'>Lightgallery</a> &ndash; ~55KB JS (+ Optional plugins), ~24KB CSS, ~26KB fonts: Released under the GPL v3 license.",
63 + 'photoswipe' => "<a href='https://github.com/dimsemenov/PhotoSwipe/tree/v4.1.3'>PhotoSwipe</a> &ndash; ~41KB JS, ~11KB CSS: Released under the MIT license. No video support for Flickr.",
64 + 'photoswipe5' => "<a href='https://photoswipe.com/'>PhotoSwipe 5</a> &ndash; ~66KB JS, ~5KB CSS: Released under the MIT license. No support for old browsers, no video support for Flickr.",
65 + 'spotlight' => "<a href='https://nextapps-de.github.io/spotlight/'>Spotlight</a> &ndash; ~10KB JS, ~12KB CSS: Released under the Apache 2.0 license.",
66 + 'venobox' => '<a href="https://veno.es/venobox/">VenoBox</a> &ndash; ~16KB JS, ~15KB CSS: Released under the MIT license.',
67 + ],
68 + ],
69 + 'jquery' => [
70 + 'header' => 'jQuery Libraries',
71 + 'description' => "<p>These libraries will automatically load the jQuery library (<strong>~95KB</strong>) to function. This is probably OK if your theme or other plugins are already using jQuery.</p><br/>",
72 + 'options' => [
73 + 'colorbox' => "<a href='https://www.jacklmoore.com/colorbox/'>Colorbox</a> &ndash; ~12KB JS, ~5KB CSS: Released under the MIT license.",
74 + 'fancybox3' => "<a href='https://fancyapps.com/fancybox/3/'>FancyBox 3</a> &ndash; ~67KB JS, ~16KB CSS: Released under the GPL v3 license.",
75 + 'featherlight' => "<a href='https://noelboss.github.io/featherlight/'>Featherlight</a> &ndash; ~13KB JS, ~5KB CSS: Released under the MIT license.",
76 + 'imagelightbox' => "<a href='https://osvaldas.info/image-lightbox-responsive-touch-friendly'>Image Lightbox</a> &ndash; ~6KB JS, ~5KB CSS: Released under the MIT license. No video support.",
77 + 'lightcase' => "<a href='https://cornel.bopp-art.com/lightcase/'>LightCase</a> &ndash; ~26KB JS, ~14KB CSS: Released under the GPL license.",
78 + 'swipebox' => "<a href='https://brutaldesign.github.io/swipebox/'>Swipebox</a> &ndash; ~12KB, ~5KB CSS: Released under the MIT license.",
79 + 'thickbox' => "Thickbox &ndash; ~12KB: Released under the MIT license. No video support.",
80 + ],
81 + ],
82 + 'others' => [
83 + 'header' => 'Others',
84 + 'options' => [
85 + 'none' => "None &ndash; If you don't want to use a lightbox, pick this option.",
86 + 'custom' => "Non-bundled &ndash; You have to provide the JS and CSS links in the next option. See <a href='https://aquoid.com/plugins/photonic/third-party-lightboxes/'>here</a> for instructions",
87 + ],
88 + ],
89 + ]
90 + ],
63 91
64 - ['name' => "Non-bundled Lightbox libraries",
65 - 'desc' => "If you don't like the above libraries, you can try one of the following. These are not distributed with the theme for various reasons,
66 - predominant being licensing restrictions. <strong>Photonic doesn't support installation of these scripts</strong>. If you want to use them,
92 + [
93 + 'name' => "Non-bundled Lightbox libraries",
94 + 'desc' => "If you don't like the above libraries, you can try one of the following. These are not distributed with the plugin for various reasons,
95 + predominant being licensing restrictions and lack of maintenance. <strong>Photonic doesn't support installation of these scripts</strong>. If you want to use them,
67 96 you will need to specify their JS and CSS files in subsequent options, unless they come bundled with your theme.",
68 - 'id' => "custom_lightbox",
97 + 'id' => 'custom_lightbox',
69 98 'grouping' => 'generic-settings',
70 - 'type' => 'radio',
71 - 'options' => [
72 - "fancybox2" => "<a href='http://fancyapps.com/fancybox/'>FancyBox 2</a>: Released under the CC-BY-NC 3.0 license",
73 - "strip" => "<a href='http://www.stripjs.com/'>Strip</a>: Released under the CC-BY-NC-ND 3.0 license. YouTube and Vimeo supported, but no support for videos from Flickr etc.",
74 - ]],
99 + 'type' => 'radio-group',
100 + 'options' => [
101 + 'non-gpl' => [
102 + 'header' => 'Not GPL-Compatible',
103 + 'description' => "<p>These cannot be distributed with Photonic due to licensing restrictions. However, you are free to download them from their websites as long as you adhere to their terms of service.</p><br/>",
104 + 'options' => [
105 + 'fancybox2' => "<a href='https://fancyapps.com/fancybox/'>FancyBox 2</a>: Released under the CC-BY-NC 3.0 license",
106 + // 'fancybox4' => "<a href='https://fancyapps.com/'>FancyBox 4</a>: Released under a proprietary license that prevents redistribution. Use the UMD version of the JS file from <a href='https://github.com/fancyapps/ui/tree/main/dist'>here</a>.",
107 + ],
108 + ],
109 + 'obsolete' => [
110 + 'header' => 'Obsolete',
111 + 'description' => "<p>The developers of the following have not updated these libraries for several years. It is possible that your theme or another plugin is offering it, or you may download them off the web.
112 + <strong style='color: red'>However, it is strongly recommended that you don't use these due to potential security concerns.</strong> Use the suggested alternatives instead.</p><br/>",
113 + 'options' => [
114 + 'fancybox' => "<a href='https://fancybox.net/'>FancyBox 1</a> &ndash; ~15KB JS, ~4KB CSS: MIT / GPL licenses. <strong style='color: red'>No update since November 2010;</strong> use Fancybox 3 instead.",
115 + 'magnific' => "<a href='https://dimsemenov.com/plugins/magnific-popup/'>Magnific Popup</a> &ndash; ~20KB JS, ~7KB CSS: MIT license. <strong style='color: red'>No update since Feb 2016;</strong> use VenoBox instead.",
116 + 'prettyphoto' => "<a href='http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/'>PrettyPhoto</a> &ndash; ~18KB JS, ~22KB CSS: GPL v2.0 license. YouTube and Vimeo supported, but no support for videos from Flickr etc. <strong style='color: red'>No update since May 2015;</strong> use Spotlight instead.",
117 + 'strip' => "<a href='https://github.com/staaky/strip'>Strip</a> &ndash; ~39KB JS, ~9KB CSS: Released under the CC-BY 4.0 license. YouTube and Vimeo supported, but no support for videos from Flickr etc. <strong style='color: red'>No update since September 2021 and the GitHub repository is archived;</strong> use Venobox instead.",
118 + ],
119 + ],
120 + ]
121 + ],
75 122
76 - ['name' => "Non-bundled Lightbox JS",
77 - 'desc' => "If you have chosen a custom lightbox library from the above, enter the full URLs of the JS files for each of them.
78 - <strong>Please enter one URL per line</strong>. Note that your URL should start with <code>http://...</code> and you should be able to visit that entry in a browser",
79 - 'id' => "custom_lightbox_js",
123 + [
124 + 'name' => "Non-bundled Lightbox JS",
125 + 'desc' => "If you have chosen a custom lightbox library from the above, enter the full URLs of the JS files for each of them.
126 + <strong>Please enter one URL per line</strong>. Note that your URL should start with <code>https://...</code> or <code>https://...</code>, and you should be able to visit that entry in a browser",
127 + 'id' => 'custom_lightbox_js',
80 128 'grouping' => 'generic-settings',
81 - 'type' => 'textarea'],
129 + 'type' => 'textarea'
130 + ],
82 131
83 - ['name' => "Custom Lightbox CSS",
84 - 'desc' => "If you have chosen a custom lightbox library from the above, enter the full URLs of the CSS files for each of them.
85 - <strong>Please enter one URL per line</strong>. Note that your URL should start with <code>http://...</code> and you should be able to visit that entry in a browser",
86 - 'id' => "custom_lightbox_css",
132 + [
133 + 'name' => "Custom Lightbox CSS",
134 + 'desc' => "If you have chosen a custom lightbox library from the above, enter the full URLs of the CSS files for each of them.
135 + <strong>Please enter one URL per line</strong>. Note that your URL should start with <code>https://...</code> or <code>https://...</code>, and you should be able to visit that entry in a browser",
136 + 'id' => 'custom_lightbox_css',
87 137 'grouping' => 'generic-settings',
88 - 'type' => 'textarea'],
138 + 'type' => 'textarea'
139 + ],
89 140
90 - ['name' => "Don't include third-party lightbox scripts",
91 - 'desc' => "If your theme or another plugin is supplying a lightbox script from the list above, you have the option to disable loading the same script from Photonic. <strong>This will save you some bandwidth, but you will have to work with the support for your theme or the other plugin to resolve issues.</strong>",
92 - 'id' => "disable_photonic_lightbox_scripts",
141 + [
142 + 'name' => "Don't include third-party lightbox scripts",
143 + 'desc' => "If your theme or another plugin is supplying a lightbox script from the list above, you have the option to disable loading the same script from Photonic. <strong>This will save you some bandwidth, but you will have to work with the support for your theme or the other plugin to resolve issues.</strong>",
144 + 'id' => 'disable_photonic_lightbox_scripts',
93 145 'grouping' => 'generic-settings',
94 - 'type' => 'checkbox'
146 + 'type' => 'checkbox'
95 147 ],
96 148
97 - ['name' => "Don't include third-party slider scripts",
98 - 'desc' => "If your theme or another plugin is supplying the <a href='https://sachinchoolur.github.io/lightslider/'>LightSlider script</a> (used for slideshow layouts), you have the option to disable loading the same script from Photonic. <strong>This will save you some bandwidth, but you will have to work with the support for your theme or the other plugin to resolve issues.</strong>",
99 - 'id' => "disable_photonic_slider_scripts",
149 + [
150 + 'name' => "Don't include third-party slider scripts",
151 + 'desc' => "If your theme or another plugin is supplying the <a href='https://splidejs.com'>Splide script</a> (used for slideshow layouts), you have the option to disable loading the same script from Photonic. <strong>This will save you some bandwidth, but you will have to work with the support for your theme or the other plugin to resolve issues.</strong>",
152 + 'id' => 'disable_photonic_slider_scripts',
100 153 'grouping' => 'generic-settings',
101 - 'type' => 'checkbox'
154 + 'type' => 'checkbox'
102 155 ],
103 156
104 - ['name' => "Photonic Lightbox for non-Photonic Images",
105 - 'desc' => "Selecting this will let you use Photonic's lightbox for non-Photonic images. This eliminates the need for a separate lightbox plugin.",
106 - 'id' => "lightbox_for_all",
157 + [
158 + 'name' => "Photonic Lightbox for non-Photonic Images",
159 + 'desc' => "Selecting this will let you use Photonic's lightbox for non-Photonic images. This eliminates the need for a separate lightbox plugin.",
160 + 'id' => 'lightbox_for_all',
107 161 'grouping' => 'generic-settings',
108 - 'type' => 'checkbox'
162 + 'type' => 'checkbox'
109 163 ],
110 164
111 - ['name' => "Photonic Lightbox for non-Photonic videos (YouTube / Vimeo etc.)",
112 - 'desc' => "Selecting this will let you use Photonic's lightbox for YouTube / Vimeo or self-hosted videos. This eliminates the need for a separate lightbox plugin.",
113 - 'id' => "lightbox_for_videos",
165 + [
166 + 'name' => "Photonic Lightbox for non-Photonic videos (YouTube / Vimeo etc.)",
167 + 'desc' => "Selecting this will let you use Photonic's lightbox for YouTube / Vimeo or self-hosted videos. This eliminates the need for a separate lightbox plugin.",
168 + 'id' => 'lightbox_for_videos',
114 169 'grouping' => 'generic-settings',
115 - 'type' => 'checkbox'
170 + 'type' => 'checkbox'
116 171 ],
117 172
118 - ['name' => "Include Photonic JS for non-Photonic Images / Videos",
119 - 'desc' => "By default Photonic's JavaScript is only loaded on pages that have Photonic galleries. This will cause issues on pages that have no Photonic galleries but are using Photonic for non-Photonic images. By checking this option you will be including the JS on all pages regardless of whether they have Photonic galleries.
173 + [
174 + 'name' => "Include Photonic JS for non-Photonic Images / Videos",
175 + 'desc' => "By default Photonic's JavaScript is only loaded on pages that have Photonic galleries. This will cause issues on pages that have no Photonic galleries but are using Photonic for non-Photonic images. By checking this option you will be including the JS on all pages regardless of whether they have Photonic galleries.
120 176 Alternatively if you don't want to load the scripts on all pages, you can create a blank shortcode at the top of your post with the photos this way:
121 177 <ol>
122 178 <li>If you are using the <code>gallery</code> shortcode put in <code>[gallery style='square']</code></li>
123 179 <li>If you are using a custom shortcode from the first option on this page, e.g. <code>photonic</code> put in <code>[photonic]</code></li>
@@ -122,392 +178,456 @@
122 178 <li>If you are using the <code>gallery</code> shortcode put in <code>[gallery style='square']</code></li>
123 179 <li>If you are using a custom shortcode from the first option on this page, e.g. <code>photonic</code> put in <code>[photonic]</code></li>
124 180 </ol>
125 181 Creating a blank shortcode will ensure that this page will get the scripts, and will not load the script on other pages.",
126 - 'id' => "always_load_scripts",
182 + 'id' => 'always_load_scripts',
127 183 'grouping' => 'generic-settings',
128 - 'type' => 'checkbox'
184 + 'type' => 'checkbox'
129 185 ],
130 186
131 - ['name' => "Force JS in header when possible",
132 - 'desc' => "By default Photonic's JavaScript is loaded in the footer. For themes including RetinaJS this causes a conflict due to a <a href='https://github.com/strues/retinajs/issues/260'>bug in RetinaJS</a>. Selecting this option addresses this bug, <strong>however this requires the previous option (<em>Include Photonic JS for non-Photonic Images / Videos</em>) to be selected</strong>.",
133 - 'id' => "js_in_header",
187 + [
188 + 'name' => "Force JS in header when possible",
189 + 'desc' => "By default Photonic's JavaScript is loaded in the footer. For themes including RetinaJS this causes a conflict due to a <a href='https://github.com/strues/retinajs/issues/260'>bug in RetinaJS</a>. Selecting this option addresses this bug, <strong>however this requires the previous option (<em>Include Photonic JS for non-Photonic Images / Videos</em>) to be selected</strong>.",
190 + 'id' => 'js_in_header',
134 191 'grouping' => 'generic-settings',
135 - 'type' => 'checkbox'
192 + 'type' => 'checkbox'
136 193 ],
137 194
138 - ['name' => "Disable shortcode editing in Visual Editor",
139 - 'desc' => "Occasionally the shortcode editor might cause JavaScript conflicts with other plugins. If that happens, select this option. Note that even if this option is selected, <strong>you will see a \"No items found\" message in the visual editor. Your gallery will still work, and you can edit the shortcode via the \"Text Editor\"</strong>.",
140 - 'id' => "disable_editor",
195 + [
196 + 'name' => "Disable shortcode editing in Visual Editor",
197 + 'desc' => "Occasionally the shortcode editor might cause JavaScript conflicts with other plugins. If that happens, select this option. Note that even if this option is selected, <strong>you will see a \"No items found\" message in the visual editor. Your gallery will still work, and you can edit the shortcode via the \"Text Editor\"</strong>.",
198 + 'id' => 'disable_editor',
141 199 'grouping' => 'generic-settings',
142 - 'type' => 'checkbox'
200 + 'type' => 'checkbox'
143 201 ],
144 202
145 - ['name' => "Disable Visual Editing for specific post types",
146 - 'desc' => "If you have disabled the Visual Editor in the previous option, you can selectively disable the editor for specific post types. <strong>Not selecting anything will keep it disabled for all post types.</strong> Note that you can still edit the shortcode via the \"Text Editor\".",
147 - 'id' => "disable_editor_post_type",
203 + [
204 + 'name' => "Disable Visual Editing for specific post types",
205 + 'desc' => "If you have disabled the Visual Editor in the previous option, you can selectively disable the editor for specific post types. <strong>Not selecting anything will keep it disabled for all post types.</strong> Note that you can still edit the shortcode via the \"Text Editor\".",
206 + 'id' => 'disable_editor_post_type',
148 207 'grouping' => 'generic-settings',
149 - 'options' => Utilities::get_formatted_post_type_array(),
150 - 'type' => "multi-select"
208 + 'options' => Utilities::get_formatted_post_type_array(),
209 + 'type' => "multi-select"
151 210 ],
152 211
153 - ['name' => "Use traditional interface for editing in Visual Editor",
154 - 'desc' => 'If shortcode editing in the visual editor is permitted (globally or for a post type in the above options), this option will show you a flat list of all attributes instead of a wizard for building your gallery.',
155 - 'id' => "disable_flow_editor",
212 + [
213 + 'name' => "Use traditional interface for editing in Visual Editor",
214 + 'desc' => 'If shortcode editing in the visual editor is permitted (globally or for a post type in the above options), this option will show you a flat list of all attributes instead of a wizard for building your gallery.',
215 + 'id' => 'disable_flow_editor',
156 216 'grouping' => 'generic-settings',
157 - 'type' => 'checkbox'
217 + 'type' => 'checkbox'
158 218 ],
159 219
160 - ['name' => "Globally turn off Gallery Wizard",
161 - 'desc' => 'If selected, the only way to add galleries will be via <em>Add Media &rarr; Photonic</em>.',
162 - 'id' => "disable_flow_editor_global",
220 + [
221 + 'name' => "Globally turn off Gallery Wizard",
222 + 'desc' => 'If selected, the only way to add galleries will be via <em>Add Media &rarr; Photonic</em>.',
223 + 'id' => 'disable_flow_editor_global',
163 224 'grouping' => 'generic-settings',
164 - 'type' => 'checkbox'
225 + 'type' => 'checkbox'
165 226 ],
166 227
167 - ['name' => "Nested Shortcodes in parameters",
168 - 'desc' => "Allow parameters of the gallery shortcode to use shortcodes themselves",
169 - 'id' => "nested_shortcodes",
228 + [
229 + 'name' => "Turn off Photonic on \"Latest Posts\"",
230 + 'desc' => "If you have too many posts that make use of Photonic galleries, displaying them on your \"Latest Posts\" page (also known as your blog page) can slow down your page. You can disable the shortcode on such pages by checking this option",
231 + 'id' => 'disable_on_home_page',
170 232 'grouping' => 'generic-settings',
171 - 'type' => 'checkbox'
233 + 'type' => 'checkbox'
172 234 ],
173 235
174 - ['name' => "External Link Handling",
175 - 'desc' => "Let the links to external sites (like Flickr or Instagram) open in a new tab/window.",
176 - 'id' => "external_links_in_new_tab",
236 + [
237 + 'name' => "Turn off Photonic on Archive Pages",
238 + 'desc' => "If you have too many posts that make use of Photonic galleries, displaying them on archive pages (such as category, tag or date archive pages) can slow down your page. You can disable the shortcode on such pages by checking this option",
239 + 'id' => 'disable_on_archives',
177 240 'grouping' => 'generic-settings',
178 - 'type' => 'checkbox'
241 + 'type' => 'checkbox'
179 242 ],
180 243
181 - ['name' => "Custom CSS in its own file",
182 - 'desc' => "When selected, Photonic will try to save the custom CSS generated through options to a file, <code>".trailingslashit(PHOTONIC_UPLOAD_DIR)."custom-styles.css</code>. You can use that file for caching.",
183 - 'id' => "css_in_file",
244 + [
245 + 'name' => "Nested Shortcodes in parameters",
246 + 'desc' => "Allow parameters of the gallery shortcode to use shortcodes themselves",
247 + 'id' => 'nested_shortcodes',
184 248 'grouping' => 'generic-settings',
185 - 'type' => 'checkbox'
249 + 'type' => 'checkbox'
186 250 ],
187 251
188 - ['name' => "Layouts",
189 - 'desc' => "Set up your layouts",
190 - 'category' => "layout-settings",
191 - 'type' => 'section',],
252 + [
253 + 'name' => "External Link Handling",
254 + 'desc' => "Let the links to external sites (like Flickr or Instagram) open in a new tab/window.",
255 + 'id' => 'external_links_in_new_tab',
256 + 'grouping' => 'generic-settings',
257 + 'type' => 'checkbox'
258 + ],
192 259
193 - ['name' => "Archive View Thumbnails",
194 - 'desc' => "How many images do you want to show per gallery at the most on archive views (e.g. Blog page, Category, Date, Tag or Author views)? All thumbnails will be visible when the post is viewed in full.",
195 - 'id' => "archive_thumbs",
196 - 'grouping' => "layout-settings",
197 - 'type' => 'text',
198 - 'hint' => "Leave blank or 0 to not restrict the number",
260 + [
261 + 'name' => "Custom CSS in its own file",
262 + 'desc' => "When selected, Photonic will try to save the custom CSS generated through options to a file, <code>" . trailingslashit(PHOTONIC_UPLOAD_DIR) . "custom-styles.css</code>. You can use that file for caching.",
263 + 'id' => 'css_in_file',
264 + 'grouping' => 'generic-settings',
265 + 'type' => 'checkbox'
199 266 ],
200 267
201 - ['name' => "Link to see remaining photos",
202 - 'desc' => "Hide the button to show remaining photos from the archive page",
203 - 'id' => "archive_link_more",
204 - 'grouping' => "layout-settings",
205 - 'type' => 'checkbox',
268 + [
269 + 'name' => "Layouts",
270 + 'desc' => 'Set up your layouts',
271 + 'category' => 'layout-settings',
272 + 'type' => 'section',
206 273 ],
207 274
208 - ['name' => "Image layout",
209 - 'desc' => "If no gallery layout is specified, the following selection will be used:",
210 - 'id' => "thumbnail_style",
211 - 'grouping' => "layout-settings",
212 - 'type' => 'select',
213 - 'options' => Utilities::layout_options(),
214 - 'hint' => 'The first four options trigger a slideshow, the rest trigger a lightbox.'
275 + [
276 + 'name' => "Image layout",
277 + 'desc' => 'If no gallery layout is specified, the following selection will be used:',
278 + 'id' => 'thumbnail_style',
279 + 'grouping' => 'layout-settings',
280 + 'type' => 'select',
281 + 'options' => Utilities::layout_options(),
282 + 'hint' => 'The first four options trigger a slideshow, the rest trigger a lightbox.'
215 283 ],
216 284
217 - ['name' => "Square / Circle Grid - Thumbnail Effect",
218 - 'desc' => "The following effect will be used for thumbnails in a square or circular thumbnail grid",
219 - 'id' => "standard_thumbnail_effect",
220 - 'grouping' => "layout-settings",
221 - 'type' => 'radio',
222 - 'options' => [
223 - 'none' => 'Thumbnails will be displayed as they are',
285 + [
286 + 'name' => "Square / Circle Grid - Thumbnail Effect",
287 + 'desc' => "The following effect will be used for thumbnails in a square or circular thumbnail grid",
288 + 'id' => 'standard_thumbnail_effect',
289 + 'grouping' => 'layout-settings',
290 + 'type' => 'radio',
291 + 'options' => [
292 + 'none' => 'Thumbnails will be displayed as they are',
224 293 'opacity' => 'Thumbnails will show up opaque, opacity will clear upon hovering',
225 - 'zoom' => 'Thumbnails will zoom in upon hovering - will not work for square thumbs with title shown below image, and for any circular thumbs',
294 + 'zoom' => 'Thumbnails will zoom in upon hovering - will not work for square thumbs with title shown below image, and for any circular thumbs',
226 295 ],
227 296 ],
228 297
229 - ['name' => "Random Justified Gallery - Padding",
230 - 'desc' => "How much spacing do you want around each photo? This is only applicable to <strong>Random Justified Galleries</strong>. The gap between two photos is double this value.",
231 - 'id' => "tile_spacing",
232 - 'grouping' => "layout-settings",
233 - 'type' => 'text',
234 - 'hint' => "Enter the number of pixels here (don't enter 'px').",
298 + [
299 + 'name' => "Random Justified Gallery - Padding",
300 + 'desc' => "How much spacing do you want around each photo? This is only applicable to <strong>Random Justified Galleries</strong>. The gap between two photos is double this value.",
301 + 'id' => 'tile_spacing',
302 + 'grouping' => 'layout-settings',
303 + 'type' => 'text',
304 + 'hint' => "Enter the number of pixels here (don't enter 'px').",
235 305 ],
236 306
237 - ['name' => "Random Justified Gallery - Minimum Tile height",
238 - 'desc' => "What is the minimum height in pixels you want to make your random tiles? By default Photonic tries to assign a height that is 1/4 of the browser window, or 200px, whichever is greater. This is only applicable to <strong>Random Tiled Galleries</strong>. Use lower values if your content window is narrow.",
239 - 'id' => "tile_min_height",
240 - 'grouping' => "layout-settings",
241 - 'type' => 'text',
242 - 'hint' => "Enter the number of pixels here (don't enter 'px').",
307 + [
308 + 'name' => "Random Justified Gallery - Minimum Tile height",
309 + 'desc' => "What is the minimum height in pixels you want to make your random tiles? By default Photonic tries to assign a height that is 1/4 of the browser window, or 200px, whichever is greater. This is only applicable to <strong>Random Tiled Galleries</strong>. Use lower values if your content window is narrow.",
310 + 'id' => 'tile_min_height',
311 + 'grouping' => 'layout-settings',
312 + 'type' => 'text',
313 + 'hint' => "Enter the number of pixels here (don't enter 'px').",
243 314 ],
244 315
245 - ['name' => "Random Justified Gallery - Thumbnail Effect",
246 - 'desc' => "The following effect will be used for tiles in a Random Justified Gallery",
247 - 'id' => "justified_thumbnail_effect",
248 - 'grouping' => "layout-settings",
249 - 'type' => 'radio',
250 - 'options' => [
251 - 'none' => 'Tiles will be displayed as they are',
316 + [
317 + 'name' => "Random Justified Gallery - Thumbnail Effect",
318 + 'desc' => "The following effect will be used for tiles in a Random Justified Gallery",
319 + 'id' => 'justified_thumbnail_effect',
320 + 'grouping' => 'layout-settings',
321 + 'type' => 'radio',
322 + 'options' => [
323 + 'none' => 'Tiles will be displayed as they are',
252 324 'opacity' => 'Tiles will show up opaque, opacity will clear upon hovering',
253 - 'zoom' => 'Tiles will zoom in upon hovering',
325 + 'zoom' => 'Tiles will zoom in upon hovering',
254 326 ],
255 327 ],
256 328
257 - ['name' => "Masonry Layout - Padding",
258 - 'desc' => "How much spacing do you want around each photo? This is only applicable to <strong>Masonry layouts</strong>. The gap between two photos is double this value.",
259 - 'id' => "masonry_tile_spacing",
260 - 'grouping' => "layout-settings",
261 - 'type' => 'text',
262 - 'hint' => "Enter the number of pixels here (don't enter 'px').",
329 + [
330 + 'name' => "Masonry Layout - Padding",
331 + 'desc' => "How much spacing do you want around each photo? This is only applicable to <strong>Masonry layouts</strong>. The gap between two photos is double this value.",
332 + 'id' => 'masonry_tile_spacing',
333 + 'grouping' => 'layout-settings',
334 + 'type' => 'text',
335 + 'hint' => "Enter the number of pixels here (don't enter 'px').",
263 336 ],
264 337
265 - ['name' => "Masonry Layout - Minimum Column Width",
266 - 'desc' => "What is the minimum width in pixels you want to make your columns in the <strong>Masonry</strong> layout? This drives responsive design.",
267 - 'id' => "masonry_min_width",
268 - 'grouping' => "layout-settings",
269 - 'type' => 'text',
270 - 'hint' => "Enter the number of pixels here (don't enter 'px').",
338 + [
339 + 'name' => "Masonry Layout - Minimum Column Width",
340 + 'desc' => "What is the minimum width in pixels you want to make your columns in the <strong>Masonry</strong> layout? This drives responsive design.",
341 + 'id' => 'masonry_min_width',
342 + 'grouping' => 'layout-settings',
343 + 'type' => 'text',
344 + 'hint' => "Enter the number of pixels here (don't enter 'px').",
271 345 ],
272 346
273 - ['name' => "Masonry Layout - Thumbnail Effect",
274 - 'desc' => "The following effect will be used for tiles in a Masonry Layout",
275 - 'id' => "masonry_thumbnail_effect",
276 - 'grouping' => "layout-settings",
277 - 'type' => 'radio',
278 - 'options' => [
279 - 'none' => 'Tiles will be displayed as they are',
347 + [
348 + 'name' => "Masonry Layout - Thumbnail Effect",
349 + 'desc' => "The following effect will be used for tiles in a Masonry Layout",
350 + 'id' => 'masonry_thumbnail_effect',
351 + 'grouping' => 'layout-settings',
352 + 'type' => 'radio',
353 + 'options' => [
354 + 'none' => 'Tiles will be displayed as they are',
280 355 'opacity' => 'Tiles will show up opaque, opacity will clear upon hovering',
281 - 'zoom' => 'Tiles will zoom in upon hovering (will not work if titles are displayed below the tile)',
356 + 'zoom' => 'Tiles will zoom in upon hovering (will not work if titles are displayed below the tile)',
282 357 ],
283 358 ],
284 359
285 - ['name' => "Mosaic Layout - Padding",
286 - 'desc' => "How much spacing do you want around each photo? This is only applicable to <strong>Mosaic layouts</strong>. The gap between two photos is double this value.",
287 - 'id' => "mosaic_tile_spacing",
288 - 'grouping' => "layout-settings",
289 - 'type' => 'text',
290 - 'hint' => "Enter the number of pixels here (don't enter 'px'). Set to &gt; 0 to avoid rounding errors in the layout.",
360 + [
361 + 'name' => "Mosaic Layout - Padding",
362 + 'desc' => "How much spacing do you want around each photo? This is only applicable to <strong>Mosaic layouts</strong>. The gap between two photos is double this value.",
363 + 'id' => 'mosaic_tile_spacing',
364 + 'grouping' => 'layout-settings',
365 + 'type' => 'text',
366 + 'hint' => "Enter the number of pixels here (don't enter 'px'). Set to &gt; 0 to avoid rounding errors in the layout.",
291 367 ],
292 368
293 - ['name' => "Mosaic Layout - Trigger width",
294 - 'desc' => "If your content is narrow, you might not want too many images in a row for the <strong>Mosaic Layout</strong>. The Trigger Width controls this behaviour. If your content is 600px wide, and you set the Trigger width to 150, Photonic will not try to fit more than 4 (= 600/150) tiles in a mosaic row.",
295 - 'id' => "mosaic_trigger_width",
296 - 'grouping' => "layout-settings",
297 - 'type' => 'text',
298 - 'hint' => "Enter the number of pixels here (don't enter 'px').",
369 + [
370 + 'name' => "Mosaic Layout - Trigger width",
371 + 'desc' => "If your content is narrow, you might not want too many images in a row for the <strong>Mosaic Layout</strong>. The Trigger Width controls this behaviour. If your content is 600px wide, and you set the Trigger width to 150, Photonic will not try to fit more than 4 (= 600/150) tiles in a mosaic row.",
372 + 'id' => 'mosaic_trigger_width',
373 + 'grouping' => 'layout-settings',
374 + 'type' => 'text',
375 + 'hint' => "Enter the number of pixels here (don't enter 'px').",
299 376 ],
300 377
301 - ['name' => "Mosaic Layout - Thumbnail Effect",
302 - 'desc' => "The following effect will be used for tiles in a Mosaic layout",
303 - 'id' => "mosaic_thumbnail_effect",
304 - 'grouping' => "layout-settings",
305 - 'type' => 'radio',
306 - 'options' => [
307 - 'none' => 'Tiles will be displayed as they are',
378 + [
379 + 'name' => "Mosaic Layout - Thumbnail Effect",
380 + 'desc' => "The following effect will be used for tiles in a Mosaic layout",
381 + 'id' => 'mosaic_thumbnail_effect',
382 + 'grouping' => 'layout-settings',
383 + 'type' => 'radio',
384 + 'options' => [
385 + 'none' => 'Tiles will be displayed as they are',
308 386 'opacity' => 'Tiles will show up opaque, opacity will clear upon hovering',
309 - 'zoom' => 'Tiles will zoom in upon hovering',
387 + 'zoom' => 'Tiles will zoom in upon hovering',
310 388 ],
311 389 ],
312 390
313 - ['name' => "Native WP Galleries",
314 - 'desc' => "Control settings for native WP gallieries, invoked by <code>[gallery id='abc']</code>",
315 - 'category' => "wp-settings",
316 - 'type' => 'section',],
391 + [
392 + 'name' => "Native WP Galleries",
393 + 'desc' => "Control settings for native WP gallieries, invoked by <code>[gallery id='abc']</code>",
394 + 'category' => 'wp-settings',
395 + 'type' => 'section',
396 + ],
317 397
318 - ['name' => "Photo titles and captions",
319 - 'desc' => "What do you want to show as the photo title in the tooltip and lightbox?",
320 - 'id' => "wp_title_caption",
321 - 'grouping' => "wp-settings",
322 - 'type' => 'select',
323 - 'options' => Utilities::title_caption_options(),],
398 + [
399 + 'name' => "Photo titles and captions for the galleries / slideshows",
400 + 'desc' => "What do you want to show as the photo title in the gallery / slideshow? This is used for the tooltips and title displays.",
401 + 'id' => 'wp_title_caption',
402 + 'grouping' => 'wp-settings',
403 + 'type' => 'select',
404 + 'options' => Utilities::title_caption_options(false, false, true),
405 + ],
324 406
325 - ['name' => "Thumbnail Title Display",
326 - 'desc' => "How do you want the title of the Thumbnails displayed?",
327 - 'id' => "wp_thumbnail_title_display",
328 - 'grouping' => "wp-settings",
329 - 'type' => 'radio',
330 - 'options' => $this->title_styles()],
407 + [
408 + 'name' => "Thumbnail Title Display",
409 + 'desc' => "How do you want the title of the Thumbnails displayed?",
410 + 'id' => 'wp_thumbnail_title_display',
411 + 'grouping' => 'wp-settings',
412 + 'type' => 'radio',
413 + 'options' => $this->title_styles()
414 + ],
331 415
332 - ['name' => "Disable lightbox linking",
333 - 'desc' => "Check this to disable linking the photo title in the lightbox to the original photo page on your site.",
334 - 'id' => "wp_disable_title_link",
335 - 'grouping' => "wp-settings",
336 - 'type' => 'checkbox'],
416 + [
417 + 'name' => "Disable lightbox linking",
418 + 'desc' => "Check this to disable linking the photo title in the lightbox to the original photo page on your site.",
419 + 'id' => 'wp_disable_title_link',
420 + 'grouping' => 'wp-settings',
421 + 'type' => 'checkbox'
422 + ],
337 423
338 - ['name' => "Slideshow settings",
339 - 'desc' => "Control settings for the slideshow layout",
340 - 'category' => "sshow-settings",
341 - 'type' => 'section',],
424 + $this->get_layout_engine_options('wp_layout_engine', 'wp-settings'),
342 425
343 - ['name' => "Prevent Slideshow Autostart",
344 - 'desc' => "By default slideshows start playing automatically. Selecting this will prevent this behaviour.",
345 - 'id' => "slideshow_prevent_autostart",
346 - 'grouping' => "sshow-settings",
347 - 'type' => 'checkbox',
426 + [
427 + 'name' => "Slideshow settings",
428 + 'desc' => "Control settings for the slideshow layout",
429 + 'category' => 'sshow-settings',
430 + 'type' => 'section',
348 431 ],
349 432
350 - ['name' => "Centre slideshow images",
351 - 'desc' => "If you pass the <code>layout</code> parameter (<code>style</code> for native WP galleries) to the <code>gallery</code> shortcode and the style is <code>strip-above</code>, <code>strip-below</code> or <code>no-strip</code> the image in the slide will be centered if you select this.",
352 - 'id' => "wp_slide_align",
353 - 'grouping' => "sshow-settings",
354 - 'type' => 'checkbox',
433 + [
434 + 'name' => "Prevent Slideshow Autostart",
435 + 'desc' => "By default slideshows start playing automatically. Selecting this will prevent this behaviour.",
436 + 'id' => 'slideshow_prevent_autostart',
437 + 'grouping' => 'sshow-settings',
438 + 'type' => 'checkbox',
355 439 ],
356 440
357 - ['name' => "Slideshow Image Adjustment",
358 - 'desc' => "If you are displaying a slideshow and your images are of uneven sizes, how do you want to handle the size differences?",
359 - 'id' => "wp_slide_adjustment",
360 - 'grouping' => "sshow-settings",
361 - 'type' => 'select',
362 - 'options' => [
363 - 'side-white' => 'Show whitespace to the side for narrower images',
364 - 'start-next' => 'Start next image to cover whitespace for narrower images',
365 - 'adapt-height' => 'Dynamically change slideshow height according to the image size',
366 - 'adapt-height-width' => 'Dynamically change slideshow height and stretch images',
367 - ]],
441 + [
442 + 'name' => "Slideshow Image Adjustment",
443 + 'desc' => "If you are displaying a slideshow and your images are of uneven sizes, how do you want to handle the size differences?",
444 + 'id' => 'wp_slide_adjustment',
445 + 'grouping' => 'sshow-settings',
446 + 'type' => 'select',
447 + 'options' => [
448 + 'side-white' => 'Fixed height: show whitespace to the side for narrower images',
449 + 'start-next' => 'Fixed height (obsolete): Start next image to cover whitespace for narrower images',
450 + 'adapt-height' => 'Dynamic height: Dynamically change slideshow height according to the image size',
451 + 'adapt-height-width' => 'Dynamically change slideshow height and stretch images to fit width',
452 + ]
453 + ],
368 454
369 - ['name' => "Overlaid Popup Panel",
370 - 'desc' => "Control settings for popup panel",
371 - 'category' => "photos-pop",
372 - 'type' => 'section',],
455 + [
456 + 'name' => "Overlaid Popup Panel",
457 + 'desc' => "Control settings for popup panel",
458 + 'category' => 'photos-pop',
459 + 'type' => 'section',
460 + ],
373 461
374 - ['name' => "What is this section?",
375 - 'desc' => "Options in this section are in effect when you click on a Photoset/album thumbnail to launch an overlaid gallery.",
376 - 'grouping' => "photos-pop",
377 - 'type' => "blurb",],
462 + [
463 + 'name' => "What is this section?",
464 + 'desc' => "Options in this section are in effect when you click on a Photoset/album thumbnail to launch an overlaid gallery.",
465 + 'grouping' => 'photos-pop',
466 + 'type' => "blurb",
467 + ],
378 468
379 - ['name' => "Enable Interim Popup for Album Thumbnails",
380 - 'desc' => "When you click on an Album / Photoset / Gallery, the lightbox automatically starts showing the images in the album. You can, instead, show an interim popup with all thumbnails for that album, then launch the lightbox upon clicking a thumbnail. This same setting is controlled from the \"Photo Template\" section as well.",
381 - 'id' => "enable_popup",
382 - 'grouping' => "photos-pop",
383 - 'type' => 'select',
384 - 'options' => [
385 - '' => esc_html__('No overlay - start showing photos in a lightbox', 'photonic'),
469 + [
470 + 'name' => "Enable Interim Popup for Album Thumbnails",
471 + 'desc' => "When you click on an Album / Photoset / Gallery, the lightbox automatically starts showing the images in the album. You can, instead, show an interim popup with all thumbnails for that album, then launch the lightbox upon clicking a thumbnail. This same setting is controlled from the \"Photo Template\" section as well.",
472 + 'id' => 'enable_popup',
473 + 'grouping' => 'photos-pop',
474 + 'type' => 'select',
475 + 'options' => [
476 + '' => esc_html__('No overlay - start showing photos in a lightbox', 'photonic'),
386 477 'show' => esc_html__('Overlay - show photos in an overlay first', 'photonic'),
387 478 'page' => esc_html__('Page - Show photos in a separate page', 'photonic'),
388 479 ],
389 480 ],
390 481
391 - ['name' => "Overlaid (popup) Gallery Panel Width",
392 - 'desc' => "When you click on a gallery, it can launch a panel on top of your page. What is the width, <b>in percentage</b>, you want to assign to this gallery?",
393 - 'id' => "popup_panel_width",
394 - 'grouping' => "photos-pop",
395 - 'type' => 'select',
396 - 'options' => $this->selection_range(1, 100)],
482 + [
483 + 'name' => "Overlaid (popup) Gallery Panel Width",
484 + 'desc' => "When you click on a gallery, it can launch a panel on top of your page. What is the width, <b>in percentage</b>, you want to assign to this gallery?",
485 + 'id' => 'popup_panel_width',
486 + 'grouping' => 'photos-pop',
487 + 'type' => 'select',
488 + 'options' => $this->selection_range(1, 100)
489 + ],
397 490
398 -
399 - ['name' => "Overlaid (popup) Gallery Panel background",
400 - 'desc' => "Setup the background of the overlaid gallery (popup).",
401 - 'id' => "flickr_gallery_panel_background",
402 - 'grouping' => "photos-pop",
403 - 'type' => "background",
404 - 'options' => [],
491 + [
492 + 'name' => "Overlaid (popup) Gallery Panel background",
493 + 'desc' => "Setup the background of the overlaid gallery (popup).",
494 + 'id' => 'flickr_gallery_panel_background',
495 + 'grouping' => 'photos-pop',
496 + 'type' => "background",
497 + 'options' => [],
405 498 ],
406 499
407 - ['name' => "Overlaid (popup) Gallery Border",
408 - 'desc' => "Setup the border of overlaid gallery (popup).",
409 - 'id' => "flickr_set_popup_thumb_border",
410 - 'grouping' => "photos-pop",
411 - 'type' => 'border',
412 - 'options' => [],
500 + [
501 + 'name' => "Photo Template",
502 + 'desc' => "Let Photonic use a standalone page as a template",
503 + 'category' => 'template-page',
504 + 'type' => 'section',
413 505 ],
414 506
415 - ['name' => "Photo Template",
416 - 'desc' => "Let Photonic use a standalone page as a template",
417 - 'category' => "template-page",
418 - 'type' => 'section',],
419 -
420 - ['name' => "Enable separate page to show album photos",
421 - 'desc' => "When you click on an Album / Photoset / Gallery, the lightbox automatically starts showing the images in the album. You can, instead, show a separate page with all thumbnails for that album, then launch the lightbox upon clicking a thumbnail. This same setting is controlled from the \"Overlaid Popup Panel\" section as well.",
422 - 'id' => "enable_popup",
423 - 'grouping' => "template-page",
424 - 'type' => 'select',
425 - 'options' => [
426 - '' => esc_html__('No overlay - start showing photos in a lightbox', 'photonic'),
507 + [
508 + 'name' => "Enable separate page to show album photos",
509 + 'desc' => "When you click on an Album / Photoset / Gallery, the lightbox automatically starts showing the images in the album. You can, instead, show a separate page with all thumbnails for that album, then launch the lightbox upon clicking a thumbnail. This same setting is controlled from the \"Overlaid Popup Panel\" section as well.",
510 + 'id' => 'enable_popup',
511 + 'grouping' => 'template-page',
512 + 'type' => 'select',
513 + 'options' => [
514 + '' => esc_html__('No overlay - start showing photos in a lightbox', 'photonic'),
427 515 'show' => esc_html__('Overlay - show photos in an overlay first', 'photonic'),
428 516 'page' => esc_html__('Page - Show photos in a separate page', 'photonic'),
429 517 ],
430 518 ],
431 519
432 - ['name' => 'Dedicated page to use for gallery display',
433 - 'desc' => "By default Photonic displays galleries on the page it is invoked. Upon clicking on album thumbnails you are shown the photos of that album either in an overlaid panel, or in a lightbox.
520 + [
521 + 'name' => 'Dedicated page to use for gallery display',
522 + 'desc' => "By default Photonic displays galleries on the page it is invoked. Upon clicking on album thumbnails you are shown the photos of that album either in an overlaid panel, or in a lightbox.
434 523 Upon setting this, you can redirect users to a dedicated page that shows the contents of an album. To use this, the gallery attribute <code>popup</code> should be set to show in a dedicated page, i.e. <code>popup='page'</code>",
435 - 'id' => 'gallery_template_page',
436 - 'grouping' => "template-page",
437 - 'type' => 'select',
438 - 'options' => Utilities::get_pages()
524 + 'id' => 'gallery_template_page',
525 + 'grouping' => 'template-page',
526 + 'type' => 'select',
527 + 'options' => Utilities::get_pages()
439 528 ],
440 529
441 - ['name' => 'Page title display',
442 - 'desc' => "Set the title to be displayed on the gallery page",
443 - 'id' => 'page_title',
444 - 'grouping' => "template-page",
445 - 'type' => 'select',
446 - 'options' => [
530 + [
531 + 'name' => 'Page title display',
532 + 'desc' => "Set the title to be displayed on the gallery page",
533 + 'id' => 'page_title',
534 + 'grouping' => 'template-page',
535 + 'type' => 'select',
536 + 'options' => [
447 537 'replace-if-available' => "Show album title if available, otherwise show the title of the WordPress page",
448 - 'page' => "Show the title of the WordPress page",
538 + // 'append-if-available' => "Append album title to the page title if available, otherwise show the title of the WordPress page",
539 + 'page' => "Show the title of the WordPress page",
449 540 ]
450 541 ],
451 542
452 - ['name' => 'Page content display',
453 - 'desc' => "Set the content to be displayed on the gallery page",
454 - 'id' => 'page_content',
455 - 'grouping' => "template-page",
456 - 'type' => 'select',
457 - 'options' => [
543 + /*
544 + [
545 + 'name' => 'Page Meta Title display',
546 + 'desc' => "Set the title to be displayed on the title bar of gallery page",
547 + 'id' => 'page_meta_title',
548 + 'grouping' => 'template-page',
549 + 'type' => 'select',
550 + 'options' => [
551 + 'replace-if-available' => "Show album title if available, otherwise show the title of the WordPress page",
552 + 'prepend-if-available' => "Prepend album title to the page title if available, otherwise show the title of the WordPress page",
553 + 'append-if-available' => "Append album title to the page title if available, otherwise show the title of the WordPress page",
554 + 'page' => "Show the title of the WordPress page",
555 + ]
556 + ],
557 + */
558 +
559 + [
560 + 'name' => 'Page content display',
561 + 'desc' => "Set the content to be displayed on the gallery page",
562 + 'id' => 'page_content',
563 + 'grouping' => 'template-page',
564 + 'type' => 'select',
565 + 'options' => [
458 566 'replace-if-available' => "Show album description if available, otherwise show the content of the WordPress page",
459 - 'append-if-available' => "Append album description if available, otherwise show the content of the WordPress page",
460 - 'page' => "Show the content of the WordPress page",
567 + 'append-if-available' => "Append album description if available, otherwise show the content of the WordPress page",
568 + 'page' => "Show the content of the WordPress page",
461 569 ]
462 570 ],
463 571
464 - ['name' => "Advanced",
465 - 'desc' => "Control advanced settings for the plugin",
466 - 'category' => "advanced-settings",
467 - 'type' => 'section',],
572 + [
573 + 'name' => "Advanced",
574 + 'desc' => "Control advanced settings for the plugin",
575 + 'category' => 'advanced-settings',
576 + 'type' => 'section',
577 + ],
468 578
469 - ['name' => 'Turn off SSL verification in calls',
470 - 'desc' => "When selected, Photonic will not use SSL verification for secure calls. <strong>This is not recommended, and may only be used on development sites</strong>.",
471 - 'id' => 'ssl_verify_off',
472 - 'grouping' => "advanced-settings",
473 - 'type' => 'checkbox',
579 + [
580 + 'name' => 'Loading Mode',
581 + 'desc' => "You can configure Photonic to generate the galleries as a part of your page generation (PHP mode), or after your page has generated and rendered on the site user's browser (JS mode). The PHP mode makes your galleries crawlable by search engines, and the JS mode helps your page load faster (the gallery shows up once it is ready). The JS mode helps if you want to use caching plugins with Google Photos setups.",
582 + 'id' => 'load_mode',
583 + 'grouping' => 'advanced-settings',
584 + 'type' => 'radio',
585 + 'options' => [
586 + 'php' => "<strong>PHP Mode</strong> &ndash; Gallery markup is generated by your server before your page is sent to the browser.",
587 + 'js' => "<strong>JavaScript Mode</strong> &ndash; Gallery markup is generated by your server after your page is sent to the browser.",
588 + ]
474 589 ],
475 590
476 - ['name' => 'Increase cURL timeout',
477 - 'desc' => "By default cURL requests made by WordPress time out after 10 seconds. In some cases your hosting provider might be throttling the connection speed to external services such as Flickr. In such a case bump up the timeout to something like 30 in the option below.",
478 - 'id' => "curl_timeout",
479 - 'grouping' => "advanced-settings",
480 - 'type' => 'text',
591 + [
592 + 'name' => 'Turn off SSL verification in calls',
593 + 'desc' => "When selected, Photonic will not use SSL verification for secure calls. <strong>This is not recommended, and may only be used on development sites</strong>.",
594 + 'id' => 'ssl_verify_off',
595 + 'grouping' => 'advanced-settings',
596 + 'type' => 'checkbox',
481 597 ],
482 598
483 - ['name' => 'Script Dev Mode',
484 - 'desc' => "By default Photonic loads minified versions of scripts. Select this option to load the full versions. This might help troubleshooting, or you may require this to play nice with minificaiton plugins.",
485 - 'id' => 'script_dev_mode',
486 - 'grouping' => "advanced-settings",
487 - 'type' => 'checkbox',
599 + [
600 + 'name' => 'Increase cURL timeout',
601 + 'desc' => "By default cURL requests made by WordPress time out after 10 seconds. In some cases your hosting provider might be throttling the connection speed to external services such as Flickr. In such a case bump up the timeout to something like 30 in the option below.",
602 + 'id' => 'curl_timeout',
603 + 'grouping' => 'advanced-settings',
604 + 'type' => 'text',
488 605 ],
489 606
490 - ['name' => 'Performance logging',
491 - 'desc' => "When selected, Photonic will log performance statistics for various operations. This is useful for fine-tuning. Stats are printed as HTML comments under each gallery, invisible on the front-end.",
492 - 'id' => 'performance_logging',
493 - 'grouping' => "advanced-settings",
494 - 'type' => 'checkbox',
607 + [
608 + 'name' => 'Script Dev Mode',
609 + 'desc' => "By default Photonic loads minified versions of scripts. Select this option to load the full versions. This might help troubleshooting, or you may require this to play nice with minificaiton plugins.",
610 + 'id' => 'script_dev_mode',
611 + 'grouping' => 'advanced-settings',
612 + 'type' => 'checkbox',
495 613 ],
496 614
497 - ['name' => 'Turn on debug logging',
498 - 'desc' => "Turning this on helps troubleshoot error messages. <strong>This is not recommended, and may only be used on development sites</strong>.",
499 - 'id' => 'debug_on',
500 - 'grouping' => "advanced-settings",
501 - 'type' => 'checkbox',
615 + [
616 + 'name' => 'Performance logging',
617 + 'desc' => "When selected, Photonic will log performance statistics for various operations. This is useful for fine-tuning. Stats are printed as HTML comments under each gallery, invisible on the front-end.",
618 + 'id' => 'performance_logging',
619 + 'grouping' => 'advanced-settings',
620 + 'type' => 'checkbox',
502 621 ],
503 622
623 + [
624 + 'name' => 'Turn on debug logging',
625 + 'desc' => "Turning this on helps troubleshoot error messages. <strong>This is not recommended, and may only be used on development sites</strong>.",
626 + 'id' => 'debug_on',
627 + 'grouping' => 'advanced-settings',
628 + 'type' => 'checkbox',
629 + ],
630 +
504 631 ];
505 - }
506 -
507 - public static function get_instance() {
508 - if (self::$instance == null) {
509 - self::$instance = new Generic();
510 - }
511 - return self::$instance;
512 632 }
513 633 }