Changeset 2469871
- Timestamp:
- 02/06/2021 12:23:03 AM (5 years ago)
- Location:
- lightbox-ga/trunk
- Files:
-
- 2 added
- 4 edited
-
README.md (modified) (2 diffs)
-
gaplugin-lightbox-plugin.php (modified) (2 diffs)
-
images (added)
-
images/icon.svg (added)
-
includes/AdminPage.php (modified) (9 diffs)
-
includes/LightBox.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lightbox-ga/trunk/README.md
r2352592 r2469871 1 1 # gaplugin-lightbox 2 === LightBox - GA===2 === GAPlugin - LightBox === 3 3 Author: GAUTIER Antoine 4 4 Author URI: gautierantoine.com … … 6 6 Tags: lightbox, gallery, navigation, images 7 7 Requires at least: 5.2 8 Tested up to: 5. 58 Tested up to: 5.6 9 9 Requires PHP: 7.2 10 Stable tag: 0.0 0.0210 Stable tag: 0.01.00.00 11 11 License: GPLv3 12 12 License URI: https://www.gnu.org/licenses/gpl-3.0.en.html -
lightbox-ga/trunk/gaplugin-lightbox-plugin.php
r2325991 r2469871 1 1 <?php 2 /** 3 * @package GAP-LightBox 4 */ 2 5 /* 3 Plugin Name: LightBox-GA4 Plugin URI: https://github.com/ Pepite61/gaplugin-lightbox6 Plugin Name: GAP-LightBox 7 Plugin URI: https://github.com/Gautier-Antoine/gaplugin-lightbox 5 8 Description: Plugin for the gallery in WordPress 6 Version: 0.0 0.029 Version: 0.01.00.00 7 10 8 11 Requires at least: 5.2 9 12 Requires PHP: 7.2 10 Stable tag: 0.00.0211 13 12 14 Author: GAUTIER Antoine … … 44 46 require_once 'includes/AdminPage.php'; 45 47 } 46 require_once 'includes/LightBox.php'; 48 if (!class_exists('GAPlugin\LightBox')){ 49 require_once 'includes/LightBox.php'; 50 } 51 47 52 register_uninstall_hook( __FILE__, ['GAPlugin\LightBox', 'removeOptions']); 48 53 add_action( -
lightbox-ga/trunk/includes/AdminPage.php
r2309106 r2469871 1 1 <?php 2 /** 3 * @package GAP-LightBox 4 */ 2 5 namespace GAPlugin; 3 6 /** … … 12 15 */ 13 16 PAGE = '', 17 /** 18 * @var string name for the option 19 */ 20 OPTION = '', 14 21 /** 15 22 * @var string name for the language files … … 37 44 * @var string name for the admin page 38 45 */ 39 ADMINPAGE = 'ga -admin-page';46 ADMINPAGE = 'gap-admin-page'; 40 47 41 48 public static function getfolder(){ … … 56 63 public static function removeOptions(){ 57 64 foreach (static::$list as $option) { 58 delete_option(static::PAGE . '-' . strtolower($option[' name']));65 delete_option(static::PAGE . '-' . strtolower($option['label_for'])); 59 66 } 60 67 static::removeExtraOptions(); … … 76 83 add_action('admin_init', [static::class, 'registerSettings']); 77 84 add_action('admin_menu', [static::class, 'addMenu']); 78 add_shortcode( static::PAGE . '-nav', [static::class, 'ShortcodeNav']);85 add_shortcode('GAP-' . static::PAGE, [static::class, 'ShortcodeNav']); 79 86 load_plugin_textdomain(static::LANGUAGE, false, static::FOLDER . '/languages/' ); 80 87 } … … 95 102 ); 96 103 static::getExtraSettings(); 97 foreach (static::$list as $ name){98 $class = strtolower($ name['name']);104 foreach (static::$list as $option){ 105 $class = strtolower($option['label_for']); 99 106 $title = static::PAGE . static::EXTENSION . '_' . $class; 100 107 register_setting( … … 104 111 add_settings_field( 105 112 $title, 106 $ name['name'],113 $option['label_for'], 107 114 [static::class, 'addPageFunction'], 108 115 static::PAGE . static::EXTENSION, 109 116 static::PAGE . static::EXTENSION . '_section', 110 ['class' => $class] 117 [ 118 'label_for' => $option['label_for'], 119 'class' => $class 120 ] 111 121 ); 112 122 } … … 120 130 static::ADMINPAGE, 121 131 [static::class,'GAPlugin_admin_page'], 122 'dashicons-share', 132 static::getFolder() . 'images/icon.svg', 133 // 'dashicons-share', 123 134 30 124 135 ); … … 155 166 <?php 156 167 } 168 169 /** 170 * Activate plugin 171 */ 172 public static function Activate() { 173 flush_rewrite_rules(); 174 } 175 /** 176 * Deactivate plugin 177 */ 178 public static function Deactivate() { 179 flush_rewrite_rules(); 180 } 157 181 } -
lightbox-ga/trunk/includes/LightBox.php
r2325980 r2469871 1 1 <?php 2 /** 3 * @package GAP-LightBox 4 */ 2 5 namespace GAPlugin; 3 6 /** … … 31 34 */ 32 35 public static $list = [ 33 [' name' => 'icon-arrow'],34 [' name' => 'icon-cross']36 ['label_for' => 'icon-arrow'], 37 ['label_for' => 'icon-cross'] 35 38 ]; 36 39 … … 82 85 __( 'The %1$s is activated', static::LANGUAGE) . '<br><br>' . 83 86 __( 'Add the full url to modify the %1$s', static::LANGUAGE) . ' (https://www.example.com/img.svg) <br>' . 84 __( 'If empty will show the normal icon', static::LANGUAGE) . '<br>' . 85 __( 'To use the %1$s for one picture, add the %2$s to the image (ex: thumbnails on the post page)', static::LANGUAGE) . '<br><br>' 87 __( 'If it remain empty, the %1$s will use the default icon', static::LANGUAGE) . '<br>' . 88 __( 'To use the %1$s for one picture, add the %2$s to the image (ex: thumbnails on the post page)', static::LANGUAGE) . '<br><br>' . 89 __( 'It will also appear on the WordPress galleries', static::LANGUAGE) 86 90 , 'LightBox', 'class="lightbox-one"' 87 91 ); … … 91 95 <textarea 92 96 name="<?= static::PAGE . '-' . $args['class'] ?>" 97 id="<?= $args['label_for'] ?>" 93 98 cols="30" 94 99 rows= "1" 95 title="<?php printf(__('Put your %1$s URL', static::LANGUAGE), $args[' class']) ?>"100 title="<?php printf(__('Put your %1$s URL', static::LANGUAGE), $args['label_for']) ?>" 96 101 ><?= 97 102 esc_url(get_option(static::PAGE . '-' . $args['class']))
Note: See TracChangeset
for help on using the changeset viewer.