Plugin Directory

Changeset 2086040


Ignore:
Timestamp:
05/11/2019 10:09:05 PM (7 years ago)
Author:
Znuff
Message:

Fixed some small issues

Location:
wp-imagelightbox/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-imagelightbox/trunk/readme.txt

    r2086026 r2086040  
    3939
    4040== Changelog ==
     41= r8 =
     42* Fixed an issue with the init script being present on archive pages
     43* Remove the $type from the data-imagelightbox attribute, as we don't use that anymore
    4144
    4245= r7 =
  • wp-imagelightbox/trunk/wp-imagelightbox.php

    r2086026 r2086040  
    44 * Plugin URI: https://linge-ma.ro/wp-imagelightbox
    55 * Description: Responsive and Touch-Friendly Lightbox for Wordpress, JS by Osvaldas Valutis.
    6  * Version: r7
     6 * Version: r8
    77 * Author: Znuff
    88 * Author URI: https://linge-ma.ro
     
    1111
    1212function iljs_enqueue() {
    13    wp_enqueue_style('imagelightbox', plugin_dir_url(__FILE__).'imagelightbox.css', false, 'r6');
    14    wp_enqueue_script('imagelightbox', plugin_dir_url(__FILE__).'imagelightbox.js', array('jquery'), 'r6', true);
     13   wp_enqueue_style('imagelightbox', plugin_dir_url(__FILE__).'imagelightbox.css', false, 'r8');
     14   wp_enqueue_script('imagelightbox', plugin_dir_url(__FILE__).'imagelightbox.js', array('jquery'), 'r8', true);
    1515}
    1616
     
    1818function iljs_mod_tags ($content) {
    1919   global $post;
    20    $type="";
    2120
    2221   $pattern = "/<a(.*?)href=('|\")(.*?).(bmp|gif|jpeg|jpg|png)('|\")(.*?)>/i";
    23    $replacement = '<a$1href=$2$3.$4$5$6 data-imagelightbox="'.$type.'">';
     22   $replacement = '<a$1href=$2$3.$4$5$6 data-imagelightbox>';
    2423   $content = preg_replace($pattern, $replacement, $content);
    2524
     
    6160      // adds the filter for image galleries
    6261      add_filter('wp_get_attachment_link','iljs_mod_tags');
     62
     63      // add init script
     64      add_action('wp_footer', 'iljs_add_trigger', 9999);
    6365   }
    6466}
    6567
    6668add_filter("template_redirect", "iljs_mod_content", 10, 1);
    67 add_action('wp_footer', 'iljs_add_trigger', 9999);
    6869?>
Note: See TracChangeset for help on using the changeset viewer.