Plugin Directory

Changeset 2469871


Ignore:
Timestamp:
02/06/2021 12:23:03 AM (5 years ago)
Author:
gautierantoine
Message:

0.01.00.00

Location:
lightbox-ga/trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • lightbox-ga/trunk/README.md

    r2352592 r2469871  
    11# gaplugin-lightbox
    2 === LightBox - GA ===
     2=== GAPlugin - LightBox ===
    33Author: GAUTIER Antoine
    44Author URI: gautierantoine.com
     
    66Tags: lightbox, gallery, navigation, images
    77Requires at least: 5.2
    8 Tested up to: 5.5
     8Tested up to: 5.6
    99Requires PHP: 7.2
    10 Stable tag: 0.00.02
     10Stable tag: 0.01.00.00
    1111License: GPLv3
    1212License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
  • lightbox-ga/trunk/gaplugin-lightbox-plugin.php

    r2325991 r2469871  
    11<?php
     2/**
     3 * @package GAP-LightBox
     4 */
    25/*
    3 Plugin Name: LightBox-GA
    4 Plugin URI: https://github.com/Pepite61/gaplugin-lightbox
     6Plugin Name: GAP-LightBox
     7Plugin URI: https://github.com/Gautier-Antoine/gaplugin-lightbox
    58Description: Plugin for the gallery in WordPress
    6 Version: 0.00.02
     9Version: 0.01.00.00
    710
    811Requires at least: 5.2
    912Requires PHP: 7.2
    10 Stable tag: 0.00.02
    1113
    1214Author: GAUTIER Antoine
     
    4446    require_once 'includes/AdminPage.php';
    4547  }
    46   require_once 'includes/LightBox.php';
     48  if (!class_exists('GAPlugin\LightBox')){
     49    require_once 'includes/LightBox.php';
     50  }
     51
    4752  register_uninstall_hook( __FILE__, ['GAPlugin\LightBox', 'removeOptions']);
    4853  add_action(
  • lightbox-ga/trunk/includes/AdminPage.php

    r2309106 r2469871  
    11<?php
     2/**
     3 * @package GAP-LightBox
     4 */
    25namespace GAPlugin;
    36/**
     
    1215    */
    1316    PAGE = '',
     17    /**
     18    * @var string name for the option
     19    */
     20    OPTION = '',
    1421    /**
    1522    * @var string name for the language files
     
    3744    * @var string name for the admin page
    3845    */
    39     ADMINPAGE = 'ga-admin-page';
     46    ADMINPAGE = 'gap-admin-page';
    4047
    4148  public static function getfolder(){
     
    5663  public static function removeOptions(){
    5764    foreach (static::$list as $option) {
    58       delete_option(static::PAGE . '-' . strtolower($option['name']));
     65      delete_option(static::PAGE . '-' . strtolower($option['label_for']));
    5966    }
    6067    static::removeExtraOptions();
     
    7683        add_action('admin_init', [static::class, 'registerSettings']);
    7784        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']);
    7986        load_plugin_textdomain(static::LANGUAGE, false, static::FOLDER . '/languages/' );
    8087    }
     
    95102          );
    96103          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']);
    99106              $title = static::PAGE . static::EXTENSION . '_' . $class;
    100107              register_setting(
     
    104111              add_settings_field(
    105112                $title,
    106                 $name['name'],
     113                $option['label_for'],
    107114                [static::class, 'addPageFunction'],
    108115                static::PAGE . static::EXTENSION,
    109116                static::PAGE . static::EXTENSION . '_section',
    110                 ['class' => $class]
     117                [
     118                  'label_for' => $option['label_for'],
     119                  'class' => $class
     120                ]
    111121              );
    112122          }
     
    120130              static::ADMINPAGE,
    121131              [static::class,'GAPlugin_admin_page'],
    122               'dashicons-share',
     132              static::getFolder() . 'images/icon.svg',
     133              // 'dashicons-share',
    123134              30
    124135          );
     
    155166        <?php
    156167    }
     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    }
    157181}
  • lightbox-ga/trunk/includes/LightBox.php

    r2325980 r2469871  
    11<?php
     2/**
     3 * @package GAP-LightBox
     4 */
    25namespace GAPlugin;
    36/**
     
    3134    */
    3235    public static $list = [
    33       ['name' => 'icon-arrow'],
    34       ['name' => 'icon-cross']
     36      ['label_for' => 'icon-arrow'],
     37      ['label_for' => 'icon-cross']
    3538    ];
    3639
     
    8285        __( 'The %1$s is activated', static::LANGUAGE) . '<br><br>' .
    8386        __( '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)
    8690        , 'LightBox', 'class="lightbox-one"'
    8791      );
     
    9195          <textarea
    9296            name="<?= static::PAGE . '-' . $args['class'] ?>"
     97            id="<?= $args['label_for'] ?>"
    9398            cols="30"
    9499            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']) ?>"
    96101          ><?=
    97102              esc_url(get_option(static::PAGE . '-' . $args['class']))
Note: See TracChangeset for help on using the changeset viewer.