WP Gallery Custom Links - Version 1.10.4

Version Description

  • Updated some text domain settings to be in accordance with the translate.wordpress.org translation system.
  • Polished up some of the help message styles to make them easier to read
  • Tested with WordPress 4.3
Download this release

Release Info

Developer fourlightsweb
Plugin Icon wp plugin WP Gallery Custom Links
Version 1.10.4
Comparing to
See all releases

Code changes from version 1.10.3 to 1.10.4

languages/wp-gallery-custom-links.pot CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the same license as the WP Gallery Custom Links package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WP Gallery Custom Links 1.10.3\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/wp-gallery-custom-"
7
  "links\n"
8
- "POT-Creation-Date: 2015-04-23 16:20:16+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
@@ -13,62 +13,62 @@ msgstr ""
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
 
16
- #: wp-gallery-custom-links.php:79
17
  msgid "Gallery Link URL"
18
  msgstr ""
19
 
20
- #: wp-gallery-custom-links.php:82
21
  msgid ""
22
  "Will replace \"Image File\" or \"Attachment Page\" link for this image in "
23
  "galleries. Use [none] to remove the link from this image in galleries."
24
  msgstr ""
25
 
26
- #: wp-gallery-custom-links.php:91
27
  msgid "Gallery Link Target"
28
  msgstr ""
29
 
30
- #: wp-gallery-custom-links.php:94
31
  msgid ""
32
  "This setting will be applied to this image in galleries regardless of "
33
  "whether or not a Gallery Link URL has been specified."
34
  msgstr ""
35
 
36
- #: wp-gallery-custom-links.php:100
37
  msgid "Do Not Change"
38
  msgstr ""
39
 
40
- #: wp-gallery-custom-links.php:101
41
  msgid "Same Window"
42
  msgstr ""
43
 
44
- #: wp-gallery-custom-links.php:102
45
  msgid "New Window"
46
  msgstr ""
47
 
48
- #: wp-gallery-custom-links.php:108
49
  msgid "Gallery Link OnClick Effect"
50
  msgstr ""
51
 
52
- #: wp-gallery-custom-links.php:111
53
  msgid ""
54
  "Lightbox and other OnClick events are removed by default from this image in "
55
  "galleries. This setting will only be applied to this image in galleries if "
56
  "this image has a Gallery Link URL specified."
57
  msgstr ""
58
 
59
- #: wp-gallery-custom-links.php:117
60
  msgid "Remove"
61
  msgstr ""
62
 
63
- #: wp-gallery-custom-links.php:118
64
  msgid "Keep"
65
  msgstr ""
66
 
67
- #: wp-gallery-custom-links.php:123
68
  msgid "Gallery Link Additional CSS Classes"
69
  msgstr ""
70
 
71
- #: wp-gallery-custom-links.php:126
72
  msgid ""
73
  "Additional CSS classes specified here will be applied to the "
74
  "<strong><em>link</em></strong> around this image in galleries regardless of "
2
  # This file is distributed under the same license as the WP Gallery Custom Links package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WP Gallery Custom Links 1.10.4\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-gallery-custom-"
7
  "links\n"
8
+ "POT-Creation-Date: 2015-09-30 16:10:59+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
 
16
+ #: wp-gallery-custom-links.php:86
17
  msgid "Gallery Link URL"
18
  msgstr ""
19
 
20
+ #: wp-gallery-custom-links.php:89
21
  msgid ""
22
  "Will replace \"Image File\" or \"Attachment Page\" link for this image in "
23
  "galleries. Use [none] to remove the link from this image in galleries."
24
  msgstr ""
25
 
26
+ #: wp-gallery-custom-links.php:98
27
  msgid "Gallery Link Target"
28
  msgstr ""
29
 
30
+ #: wp-gallery-custom-links.php:101
31
  msgid ""
32
  "This setting will be applied to this image in galleries regardless of "
33
  "whether or not a Gallery Link URL has been specified."
34
  msgstr ""
35
 
36
+ #: wp-gallery-custom-links.php:107
37
  msgid "Do Not Change"
38
  msgstr ""
39
 
40
+ #: wp-gallery-custom-links.php:108
41
  msgid "Same Window"
42
  msgstr ""
43
 
44
+ #: wp-gallery-custom-links.php:109
45
  msgid "New Window"
46
  msgstr ""
47
 
48
+ #: wp-gallery-custom-links.php:115
49
  msgid "Gallery Link OnClick Effect"
50
  msgstr ""
51
 
52
+ #: wp-gallery-custom-links.php:118
53
  msgid ""
54
  "Lightbox and other OnClick events are removed by default from this image in "
55
  "galleries. This setting will only be applied to this image in galleries if "
56
  "this image has a Gallery Link URL specified."
57
  msgstr ""
58
 
59
+ #: wp-gallery-custom-links.php:124
60
  msgid "Remove"
61
  msgstr ""
62
 
63
+ #: wp-gallery-custom-links.php:125
64
  msgid "Keep"
65
  msgstr ""
66
 
67
+ #: wp-gallery-custom-links.php:130
68
  msgid "Gallery Link Additional CSS Classes"
69
  msgstr ""
70
 
71
+ #: wp-gallery-custom-links.php:133
72
  msgid ""
73
  "Additional CSS classes specified here will be applied to the "
74
  "<strong><em>link</em></strong> around this image in galleries regardless of "
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: fourlightsweb
3
  Donate link: http://www.fourlightsweb.com/wordpress-plugins/wp-gallery-custom-links/#donate
4
  Tags: gallery links, gallery link, gallery
5
  Requires at least: 3.3.1
6
- Tested up to: 4.2
7
- Stable tag: 1.10.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -147,6 +147,11 @@ accomplish this, which is outside the scope of this plugin.
147
 
148
  == Changelog ==
149
 
 
 
 
 
 
150
  = 1.10.3 =
151
  * Added a "Do Not Change" default target option to improve performance by reducing the number of regexes to apply "_self" on every gallery item. If your theme opens all gallery items in a new window by default and you prefer to keep them in the same window, you will need to add open_all_in_same_window="true" to your gallery shortcode.
152
 
@@ -255,6 +260,11 @@ directly attached to the post.
255
 
256
  == Upgrade Notice ==
257
 
 
 
 
 
 
258
  = 1.10.3 =
259
  * Added a "Do Not Change" default target option to improve performance by reducing the number of regexes to apply "_self" on every gallery item. If your theme opens all gallery items in a new window by default and you prefer to keep them in the same window, you will need to add open_all_in_same_window="true" to your gallery shortcode.
260
 
3
  Donate link: http://www.fourlightsweb.com/wordpress-plugins/wp-gallery-custom-links/#donate
4
  Tags: gallery links, gallery link, gallery
5
  Requires at least: 3.3.1
6
+ Tested up to: 4.3.1
7
+ Stable tag: 1.10.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
147
 
148
  == Changelog ==
149
 
150
+ = 1.10.4 =
151
+ * Updated some text domain settings to be in accordance with the translate.wordpress.org translation system.
152
+ * Polished up some of the help message styles to make them easier to read
153
+ * Tested with WordPress 4.3
154
+
155
  = 1.10.3 =
156
  * Added a "Do Not Change" default target option to improve performance by reducing the number of regexes to apply "_self" on every gallery item. If your theme opens all gallery items in a new window by default and you prefer to keep them in the same window, you will need to add open_all_in_same_window="true" to your gallery shortcode.
157
 
260
 
261
  == Upgrade Notice ==
262
 
263
+ = 1.10.4 =
264
+ * Updated some text domain settings to be in accordance with the translate.wordpress.org translation system.
265
+ * Polished up some of the help message styles to make them easier to read
266
+ * Tested with WordPress 4.3
267
+
268
  = 1.10.3 =
269
  * Added a "Do Not Change" default target option to improve performance by reducing the number of regexes to apply "_self" on every gallery item. If your theme opens all gallery items in a new window by default and you prefer to keep them in the same window, you will need to add open_all_in_same_window="true" to your gallery shortcode.
270
 
wp-gallery-custom-links.php CHANGED
@@ -2,8 +2,9 @@
2
  /*
3
  Plugin Name: WP Gallery Custom Links
4
  Plugin URI: http://www.fourlightsweb.com/wordpress-plugins/wp-gallery-custom-links/
 
5
  Description: Specify custom links for WordPress gallery images (instead of attachment or file only).
6
- Version: 1.10.3
7
  Author: Four Lights Web Development
8
  Author URI: http://www.fourlightsweb.com
9
  License: GPL2
@@ -25,6 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
  add_action( 'init', array( 'WPGalleryCustomLinks', 'init' ) );
 
28
 
29
  class WPGalleryCustomLinks {
30
  // We will always be "replacing" the gallery shortcode function
@@ -44,7 +46,7 @@ class WPGalleryCustomLinks {
44
  private static $textdomain_id = 'wp-gallery-custom-links';
45
  private static $class_name = 'WPGalleryCustomLinks';
46
 
47
- public static function init() {
48
  // Add the filter for editing the custom url field
49
  add_filter( 'attachment_fields_to_edit', array( self::$class_name, 'apply_filter_attachment_fields_to_edit' ), null, 2 );
50
 
@@ -60,6 +62,11 @@ class WPGalleryCustomLinks {
60
  // Load translations
61
  load_plugin_textdomain( self::$textdomain_id, false, basename( dirname( __FILE__ ) ) . '/languages' );
62
  } // End function init()
 
 
 
 
 
63
 
64
  public static function do_action_wp_enqueue_scripts() {
65
  wp_enqueue_script(
@@ -72,13 +79,13 @@ class WPGalleryCustomLinks {
72
  }
73
 
74
  public static function apply_filter_attachment_fields_to_edit( $form_fields, $post ) {
75
- $help_css = 'display:none;position:absolute;background-color:#ffffe0;text-align:left;border:1px solid #dfdfdf;padding:10px;width:75%;font-weight:normal;border-radius:3px;';
76
 
77
  // Gallery Link URL field
78
  $form_fields['gallery_link_url'] = array(
79
  'label' => __( 'Gallery Link URL', self::$textdomain_id ) .
80
- ' <a href="#" onclick="jQuery(\'#wpgcl_gallery_link_url_help\').show(); return false;" onblur="jQuery(\'#wpgcl_gallery_link_url_help\').hide();">[?]</a>' .
81
- '<div id="wpgcl_gallery_link_url_help" style="'.$help_css.'">' .
82
  __( 'Will replace "Image File" or "Attachment Page" link for this image in galleries. Use [none] to remove the link from this image in galleries.', self::$textdomain_id ) .
83
  ' <a href="#" onclick="jQuery(\'#wpgcl_gallery_link_url_help\').hide(); return false;">[X]</a>' .
84
  '</div>',
@@ -89,8 +96,8 @@ class WPGalleryCustomLinks {
89
  $target_value = get_post_meta( $post->ID, '_gallery_link_target', true );
90
  $form_fields['gallery_link_target'] = array(
91
  'label' => __( 'Gallery Link Target', self::$textdomain_id ) .
92
- ' <a href="#" onclick="jQuery(\'#wpgcl_gallery_link_target_help\').show(); return false;" onblur="jQuery(\'#wpgcl_gallery_link_target_help\').hide();">[?]</a>' .
93
- '<div id="wpgcl_gallery_link_target_help" style="'.$help_css.'">' .
94
  __( 'This setting will be applied to this image in galleries regardless of whether or not a Gallery Link URL has been specified.', self::$textdomain_id ) .
95
  ' <a href="#" onclick="jQuery(\'#wpgcl_gallery_link_target_help\').hide(); return false;">[X]</a>' .
96
  '</div>',
@@ -106,8 +113,8 @@ class WPGalleryCustomLinks {
106
  $preserve_click_value = get_post_meta( $post->ID, '_gallery_link_preserve_click', true );
107
  $form_fields['gallery_link_preserve_click'] = array(
108
  'label' => __( 'Gallery Link OnClick Effect', self::$textdomain_id ) .
109
- ' <a href="#" onclick="jQuery(\'#wpgcl_gallery_link_preserve_click_help\').show(); return false;" onblur="jQuery(\'#wpgcl_gallery_link_preserve_click_help\').hide();">[?]</a>' .
110
- '<div id="wpgcl_gallery_link_preserve_click_help" style="'.$help_css.'">' .
111
  __( 'Lightbox and other OnClick events are removed by default from this image in galleries. This setting will only be applied to this image in galleries if this image has a Gallery Link URL specified.', self::$textdomain_id ) .
112
  ' <a href="#" onclick="jQuery(\'#wpgcl_gallery_link_preserve_click_help\').hide(); return false;">[X]</a>' .
113
  '</div>',
@@ -121,8 +128,8 @@ class WPGalleryCustomLinks {
121
  // Gallery Link additional css classes field
122
  $form_fields['gallery_link_additional_css_classes'] = array(
123
  'label' => __( 'Gallery Link Additional CSS Classes', self::$textdomain_id ) .
124
- ' <a href="#" onclick="jQuery(\'#wpgcl_gallery_link_additional_css_classes_help\').show(); return false;" onblur="jQuery(\'#wpgcl_gallery_link_additional_css_classes_help\').hide();">[?]</a>' .
125
- '<div id="wpgcl_gallery_link_additional_css_classes_help" style="'.$help_css.'">' .
126
  __( 'Additional CSS classes specified here will be applied to the <strong><em>link</em></strong> around this image in galleries regardless of whether or not a Gallery Link URL has been specified.', self::$textdomain_id ) .
127
  ' <a href="#" onclick="jQuery(\'#wpgcl_gallery_link_additional_css_classes_help\').hide(); return false;">[X]</a>' .
128
  '</div>',
2
  /*
3
  Plugin Name: WP Gallery Custom Links
4
  Plugin URI: http://www.fourlightsweb.com/wordpress-plugins/wp-gallery-custom-links/
5
+ Text Domain: wp-gallery-custom-links
6
  Description: Specify custom links for WordPress gallery images (instead of attachment or file only).
7
+ Version: 1.10.4
8
  Author: Four Lights Web Development
9
  Author URI: http://www.fourlightsweb.com
10
  License: GPL2
26
  */
27
 
28
  add_action( 'init', array( 'WPGalleryCustomLinks', 'init' ) );
29
+ add_action( 'plugins_loaded', array( 'WPGalleryCustomLinks', 'loadPluginTextDomain' ) );
30
 
31
  class WPGalleryCustomLinks {
32
  // We will always be "replacing" the gallery shortcode function
46
  private static $textdomain_id = 'wp-gallery-custom-links';
47
  private static $class_name = 'WPGalleryCustomLinks';
48
 
49
+ public static function init() {
50
  // Add the filter for editing the custom url field
51
  add_filter( 'attachment_fields_to_edit', array( self::$class_name, 'apply_filter_attachment_fields_to_edit' ), null, 2 );
52
 
62
  // Load translations
63
  load_plugin_textdomain( self::$textdomain_id, false, basename( dirname( __FILE__ ) ) . '/languages' );
64
  } // End function init()
65
+
66
+ public static function loadPluginTextDomain() {
67
+ // The codex says this is needed to load plugin language files
68
+ load_plugin_textdomain( self::$textdomain_id, false, basename( dirname( __FILE__ ) ) . '/languages' );
69
+ }
70
 
71
  public static function do_action_wp_enqueue_scripts() {
72
  wp_enqueue_script(
79
  }
80
 
81
  public static function apply_filter_attachment_fields_to_edit( $form_fields, $post ) {
82
+ $help_css = 'z-index:999;display:none;position:absolute;margin-top:-100px;background-color:#ffffe0;text-align:left;border:1px solid #dfdfdf;padding:10px;width:75%;font-weight:normal;border-radius:3px;';
83
 
84
  // Gallery Link URL field
85
  $form_fields['gallery_link_url'] = array(
86
  'label' => __( 'Gallery Link URL', self::$textdomain_id ) .
87
+ ' <a href="#" onclick="jQuery(\'.wpgcl_gallery_link_help\').hide();jQuery(\'#wpgcl_gallery_link_url_help\').show(); return false;" onblur="jQuery(\'#wpgcl_gallery_link_url_help\').hide();">[?]</a>' .
88
+ '<div id="wpgcl_gallery_link_url_help" style="'.$help_css.'" class="wpgcl_gallery_link_help">' .
89
  __( 'Will replace "Image File" or "Attachment Page" link for this image in galleries. Use [none] to remove the link from this image in galleries.', self::$textdomain_id ) .
90
  ' <a href="#" onclick="jQuery(\'#wpgcl_gallery_link_url_help\').hide(); return false;">[X]</a>' .
91
  '</div>',
96
  $target_value = get_post_meta( $post->ID, '_gallery_link_target', true );
97
  $form_fields['gallery_link_target'] = array(
98
  'label' => __( 'Gallery Link Target', self::$textdomain_id ) .
99
+ ' <a href="#" onclick="jQuery(\'.wpgcl_gallery_link_help\').hide();jQuery(\'#wpgcl_gallery_link_target_help\').show(); return false;" onblur="jQuery(\'#wpgcl_gallery_link_target_help\').hide();">[?]</a>' .
100
+ '<div id="wpgcl_gallery_link_target_help" style="'.$help_css.'" class="wpgcl_gallery_link_help">' .
101
  __( 'This setting will be applied to this image in galleries regardless of whether or not a Gallery Link URL has been specified.', self::$textdomain_id ) .
102
  ' <a href="#" onclick="jQuery(\'#wpgcl_gallery_link_target_help\').hide(); return false;">[X]</a>' .
103
  '</div>',
113
  $preserve_click_value = get_post_meta( $post->ID, '_gallery_link_preserve_click', true );
114
  $form_fields['gallery_link_preserve_click'] = array(
115
  'label' => __( 'Gallery Link OnClick Effect', self::$textdomain_id ) .
116
+ ' <a href="#" onclick="jQuery(\'.wpgcl_gallery_link_help\').hide();jQuery(\'#wpgcl_gallery_link_preserve_click_help\').show(); return false;" onblur="jQuery(\'#wpgcl_gallery_link_preserve_click_help\').hide();">[?]</a>' .
117
+ '<div id="wpgcl_gallery_link_preserve_click_help" style="'.$help_css.'" class="wpgcl_gallery_link_help">' .
118
  __( 'Lightbox and other OnClick events are removed by default from this image in galleries. This setting will only be applied to this image in galleries if this image has a Gallery Link URL specified.', self::$textdomain_id ) .
119
  ' <a href="#" onclick="jQuery(\'#wpgcl_gallery_link_preserve_click_help\').hide(); return false;">[X]</a>' .
120
  '</div>',
128
  // Gallery Link additional css classes field
129
  $form_fields['gallery_link_additional_css_classes'] = array(
130
  'label' => __( 'Gallery Link Additional CSS Classes', self::$textdomain_id ) .
131
+ ' <a href="#" onclick="jQuery(\'.wpgcl_gallery_link_help\').hide();jQuery(\'#wpgcl_gallery_link_additional_css_classes_help\').show(); return false;" onblur="jQuery(\'#wpgcl_gallery_link_additional_css_classes_help\').hide();">[?]</a>' .
132
+ '<div id="wpgcl_gallery_link_additional_css_classes_help" style="'.$help_css.'" class="wpgcl_gallery_link_help">' .
133
  __( 'Additional CSS classes specified here will be applied to the <strong><em>link</em></strong> around this image in galleries regardless of whether or not a Gallery Link URL has been specified.', self::$textdomain_id ) .
134
  ' <a href="#" onclick="jQuery(\'#wpgcl_gallery_link_additional_css_classes_help\').hide(); return false;">[X]</a>' .
135
  '</div>',