Orphans - Version 2.9.3

Version Description

  • 2022-01-20 =
  • Removed doubled "Donate" link on plugin page.
  • Updated iWorks Options to 2.8.0.
Download this release

Release Info

Developer iworks
Plugin Icon 128x128 Orphans
Version 2.9.3
Comparing to
See all releases

Code changes from version 2.9.2 to 2.9.3

includes/iworks/class-iworks-orphan.php CHANGED
@@ -298,7 +298,6 @@ class iworks_orphan {
298
  public function admin_init() {
299
  $this->options->options_init();
300
  add_filter( 'plugin_action_links_' . $this->plugin_file, array( $this, 'add_settings_link' ) );
301
- add_filter( 'plugin_action_links_' . $this->plugin_file, array( $this, 'add_donate_link' ) );
302
  }
303
 
304
  /**
@@ -405,18 +404,6 @@ class iworks_orphan {
405
  return $actions;
406
  }
407
 
408
- /**
409
- * Add donate link to plugin_row_meta.
410
- *
411
- * @since 2.6.8
412
- *
413
- * @param array $actions An array of the plugin's metadata, including the version, author, author URI, and plugin URI.
414
- */
415
- public function add_donate_link( $actions ) {
416
- $actions[] = '<a href="https://ko-fi.com/iworks?utm_source=sierotki&utm_medium=plugin-links">' . __( 'Donate', 'sierotki' ) . '</a>';
417
- return $actions;
418
- }
419
-
420
  /**
421
  * Replace orphans in custom fields.
422
  *
298
  public function admin_init() {
299
  $this->options->options_init();
300
  add_filter( 'plugin_action_links_' . $this->plugin_file, array( $this, 'add_settings_link' ) );
 
301
  }
302
 
303
  /**
404
  return $actions;
405
  }
406
 
 
 
 
 
 
 
 
 
 
 
 
 
407
  /**
408
  * Replace orphans in custom fields.
409
  *
includes/iworks/options/assets/scripts/common.js CHANGED
@@ -1,92 +1,134 @@
1
  jQuery(
2
- function(){
3
- iworks_options_tabulator_init();
4
- /**
5
- * Switch button
6
- */
7
- if ( jQuery.fn.switchButton ) {
8
- jQuery( '.iworks_options .switch-button, .iworks-options-switch-button' ).each(
9
- function() {
10
- var options = {
11
- checked: jQuery( this ).checked,
12
- on_label: jQuery( this ).data( 'on_label' ) || switch_button.labels.on_label,
13
- off_label: jQuery( this ).data( 'off_label' ) || switch_button.labels.off_label
14
- };
15
- jQuery( this ).switchButton( options );
16
- }
17
- );
18
- }
19
- /**
20
- * Color picker
21
- */
22
- if ( jQuery.fn.wpColorPicker ) {
23
- jQuery( '.wpColorPicker' ).wpColorPicker();
24
- }
25
- /**
26
- * select2
27
- */
28
- if ( jQuery.fn.select2 ) {
29
- jQuery( '.iworks-options .select2' ).select2();
30
- }
31
- /**
32
- * slider
33
- */
34
- if ( jQuery.fn.slider ) {
35
- jQuery( '.iworks-options .slider' ).each(
36
- function() {
37
- jQuery( this ).parent().append( '<div class="ui-slider"></div>' );
38
- var target = jQuery( this );
39
- var options = {
40
- value: parseInt( target.val() ),
41
- step: parseInt( target.data( 'step' ) || target.attr( 'step' ) || 1 ),
42
- min: parseInt( target.data( 'min' ) || target.attr( 'min' ) || 0 ),
43
- max: parseInt( target.data( 'max' ) || target.attr( 'max' ) || 100 ),
44
- slide: function( event, ui ) {
45
- target.val( ui.value );
46
- }
47
- };
48
- jQuery( '.ui-slider', jQuery( this ).parent() ).slider( options );
49
- }
50
- );
51
- }
52
- }
53
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  /**
55
  * Tabulator Bootup
56
  */
57
- function iworks_options_tabulator_init()
58
- {
59
- if ( ! jQuery( "#hasadmintabs" ).length) {
60
- return;
61
- }
62
- jQuery( '#hasadmintabs' ).prepend( "<ul><\/ul>" );
63
- jQuery( '#hasadmintabs > fieldset' ).each(
64
- function(i){
65
- id = jQuery( this ).attr( 'id' );
66
- rel = jQuery( this ).attr( 'rel' );
67
- caption = jQuery( this ).find( 'h3' ).text();
68
- if ( rel ) {
69
- rel = ' class="' + rel + '"';
70
- }
71
- jQuery( '#hasadmintabs > ul' ).append( '<li><a href="#' + id + '"><span' + rel + '>' + caption + "<\/span><\/a><\/li>" );
72
- jQuery( this ).find( 'h3' ).hide();
73
- }
74
- );
75
- index = 0;
76
- jQuery( '#hasadmintabs h3' ).each(
77
- function(i){
78
- if ( jQuery( this ).hasClass( 'selected' ) ) {
79
- index = i;
80
- }
81
- }
82
- );
83
- if ( index < 0 ) {
84
- index = 0;
85
- }
86
- jQuery( "#hasadmintabs" ).tabs( { active: index } );
87
- jQuery( '#hasadmintabs ul a' ).click(
88
- function(i){
89
- jQuery( '#hasadmintabs #last_used_tab' ).val( jQuery( this ).parent().index() );
90
- }
91
- );
92
- }
 
1
  jQuery(
2
+ function() {
3
+ iworks_options_tabulator_init();
4
+ /**
5
+ * Switch button
6
+ */
7
+ if (jQuery.fn.switchButton) {
8
+ jQuery('.iworks_options .switch-button, .iworks-options-switch-button').each(
9
+ function() {
10
+ var options = {
11
+ checked: jQuery(this).checked,
12
+ on_label: jQuery(this).data('on_label') || switch_button.labels.on_label,
13
+ off_label: jQuery(this).data('off_label') || switch_button.labels.off_label
14
+ };
15
+ jQuery(this).switchButton(options);
16
+ }
17
+ );
18
+ }
19
+ /**
20
+ * Color picker
21
+ */
22
+ if (jQuery.fn.wpColorPicker) {
23
+ jQuery('.wpColorPicker').wpColorPicker();
24
+ }
25
+ /**
26
+ * select2
27
+ */
28
+ if (jQuery.fn.select2) {
29
+ jQuery('.iworks-options .select2').select2();
30
+ }
31
+ /**
32
+ * slider
33
+ */
34
+ if (jQuery.fn.slider) {
35
+ jQuery('.iworks-options .slider').each(
36
+ function() {
37
+ jQuery(this).parent().append('<div class="ui-slider"></div>');
38
+ var target = jQuery(this);
39
+ var options = {
40
+ value: parseInt(target.val()),
41
+ step: parseInt(target.data('step') || target.attr('step') || 1),
42
+ min: parseInt(target.data('min') || target.attr('min') || 0),
43
+ max: parseInt(target.data('max') || target.attr('max') || 100),
44
+ slide: function(event, ui) {
45
+ target.val(ui.value);
46
+ }
47
+ };
48
+ jQuery('.ui-slider', jQuery(this).parent()).slider(options);
49
+ }
50
+ );
51
+ }
52
+ }
53
  );
54
+ /**
55
+ * Media
56
+ */
57
+ jQuery(document).ready(function($) {
58
+ var iworks_options_media = [];
59
+ $('input.iworks_delete_button').on('click', function(e) {
60
+ var $parent = $(this).closest('td');
61
+ e.preventDefault();
62
+ $('img', $parent).attr('src', '');
63
+ $('input[type=hidden]', $parent).val(0);
64
+ $(this).hide();
65
+ });
66
+ $('input.iworks_upload_button').on('click', function(e) {
67
+ var $parent = $(this).closest('td');
68
+ var key = $(this).attr('rel');
69
+ e.preventDefault();
70
+ // Extend the wp.media object
71
+ if (iworks_options_media[key]) {
72
+ iworks_options_media[key].open();
73
+ return;
74
+ }
75
+ iworks_options_media[key] = wp.media.frames.file_frame = wp.media({
76
+ title: window.iworks_options.buttons.select_media,
77
+ button: {
78
+ text: window.iworks_options.buttons.select_media,
79
+ rel: this,
80
+ },
81
+ multiple: false
82
+ });
83
+
84
+ // When a file is selected, grab the URL and set it as the text field's value
85
+ iworks_options_media[key].on('select', function() {
86
+ var attachment = iworks_options_media[key].state().get('selection').first().toJSON();
87
+ $('img', $parent).attr('src', attachment.url);
88
+ $('input[type=hidden]', $parent).val(attachment.id);
89
+ $('input.iworks_delete_button', $parent).show();
90
+ });
91
+ // Open the upload dialog
92
+ iworks_options_media[key].open();
93
+ });
94
+ });
95
  /**
96
  * Tabulator Bootup
97
  */
98
+ function iworks_options_tabulator_init() {
99
+ if (!jQuery("#hasadmintabs").length) {
100
+ return;
101
+ }
102
+ jQuery('#hasadmintabs').prepend("<ul><\/ul>");
103
+ jQuery('#hasadmintabs > fieldset').each(
104
+ function(i) {
105
+ id = jQuery(this).attr('id');
106
+ rel = jQuery(this).attr('rel');
107
+ caption = jQuery(this).find('h3').text();
108
+ if (rel) {
109
+ rel = ' class="' + rel + '"';
110
+ }
111
+ jQuery('#hasadmintabs > ul').append('<li><a href="#' + id + '"><span' + rel + '>' + caption + "<\/span><\/a><\/li>");
112
+ jQuery(this).find('h3').hide();
113
+ }
114
+ );
115
+ index = 0;
116
+ jQuery('#hasadmintabs h3').each(
117
+ function(i) {
118
+ if (jQuery(this).hasClass('selected')) {
119
+ index = i;
120
+ }
121
+ }
122
+ );
123
+ if (index < 0) {
124
+ index = 0;
125
+ }
126
+ jQuery("#hasadmintabs").tabs({
127
+ active: index
128
+ });
129
+ jQuery('#hasadmintabs ul a').click(
130
+ function(i) {
131
+ jQuery('#hasadmintabs #last_used_tab').val(jQuery(this).parent().index());
132
+ }
133
+ );
134
+ }
includes/iworks/options/options.php CHANGED
@@ -3,7 +3,7 @@
3
  Class Name: iWorks Options
4
  Class URI: http://iworks.pl/
5
  Description: Option class to manage options.
6
- Version: 2.7.3
7
  Author: Marcin Pietrzak
8
  Author URI: http://iworks.pl/
9
  License: GPLv2 or later
@@ -70,7 +70,7 @@ class iworks_options {
70
  * basic setup
71
  */
72
  $this->notices = array();
73
- $this->version = '2.7.3';
74
  $this->option_group = 'index';
75
  $this->option_function_name = null;
76
  $this->option_prefix = null;
@@ -727,35 +727,37 @@ class iworks_options {
727
  );
728
  break;
729
  case 'image':
730
- if ( isset( $option['description'] ) && $option['description'] ) {
731
- printf( '<p class="description">%s</p>', $option['description'] );
 
 
 
 
732
  }
733
- $value = $this->get_option( $option_name, $option_group );
734
  $content .= sprintf(
735
  '<img id="%s_img" src="%s" alt="" style="%s%sclear:right;display:block;margin-bottom:10px;" />',
736
  $html_element_name,
737
- $value ? $value : '',
738
  array_key_exists( 'max-width', $option ) && is_integer( $option['max-width'] ) ? sprintf( 'max-width: %dpx;', $option['max-width'] ) : '',
739
  array_key_exists( 'max-height', $option ) && is_integer( $option['max-height'] ) ? sprintf( 'max-height: %dpx;', $option['max-height'] ) : ''
740
  );
741
  $content .= sprintf(
742
- '<input type="hidden" name="%s" id="%s" value="%s" />',
743
- $this->get_option( $option_name, $option_group ),
744
  $this->get_option( $option_name, $option_group ),
745
  $value
746
  );
747
  $content .= sprintf(
748
  ' <input type="button" class="button iworks_upload_button" value="%s" rel="#%s" />',
749
- __( 'Upload image', 'sierotki' ),
750
  $html_element_name
751
  );
752
- if ( ! empty( $value ) || ( array_key_exists( 'default', $option ) && $value != $option['default'] ) ) {
753
- $content .= sprintf(
754
- ' <input type="submit" class="button iworks_delete_button" value="%s" rel="#%s%s" />',
755
- __( 'Delete image', 'sierotki' ),
756
- $html_element_name
757
- );
758
- }
759
  break;
760
  /**
761
  * handle `button` field type
@@ -1743,9 +1745,14 @@ postboxes.add_postbox_toggles('<?php echo $this->pagehooks[ $option_name ]; ?>')
1743
  'file' => 'jquery-ui.min.css',
1744
  ),
1745
  array(
1746
- 'handle' => __CLASS__,
1747
- 'file' => 'common.js',
1748
- 'deps' => array( 'jquery', 'switch_button', 'jquery-ui-tabs' ),
 
 
 
 
 
1749
  ),
1750
  /**
1751
  * switch checkbox
3
  Class Name: iWorks Options
4
  Class URI: http://iworks.pl/
5
  Description: Option class to manage options.
6
+ Version: 2.8.0
7
  Author: Marcin Pietrzak
8
  Author URI: http://iworks.pl/
9
  License: GPLv2 or later
70
  * basic setup
71
  */
72
  $this->notices = array();
73
+ $this->version = '2.8.0';
74
  $this->option_group = 'index';
75
  $this->option_function_name = null;
76
  $this->option_prefix = null;
727
  );
728
  break;
729
  case 'image':
730
+ if ( is_admin() ) {
731
+ wp_enqueue_media();
732
+ }
733
+ $src = $value = $this->get_option( $option_name, $option_group );
734
+ if ( preg_match( '/^\d+/', $value ) && 0 < intval( $value ) ) {
735
+ $src = wp_get_attachment_url( $value );
736
  }
 
737
  $content .= sprintf(
738
  '<img id="%s_img" src="%s" alt="" style="%s%sclear:right;display:block;margin-bottom:10px;" />',
739
  $html_element_name,
740
+ $src ? $src : '',
741
  array_key_exists( 'max-width', $option ) && is_integer( $option['max-width'] ) ? sprintf( 'max-width: %dpx;', $option['max-width'] ) : '',
742
  array_key_exists( 'max-height', $option ) && is_integer( $option['max-height'] ) ? sprintf( 'max-height: %dpx;', $option['max-height'] ) : ''
743
  );
744
  $content .= sprintf(
745
+ '<input type="hidden" name="%s" value="%s" />',
746
+ $html_element_name,
747
  $this->get_option( $option_name, $option_group ),
748
  $value
749
  );
750
  $content .= sprintf(
751
  ' <input type="button" class="button iworks_upload_button" value="%s" rel="#%s" />',
752
+ __( 'Select Image', 'sierotki' ),
753
  $html_element_name
754
  );
755
+ $content .= sprintf(
756
+ ' <input type="button" class="button iworks_delete_button" value="%s" rel="#%s" %s/>',
757
+ __( 'Delete image', 'sierotki' ),
758
+ $html_element_name,
759
+ empty( $value ) ? ' style="display:none"' : ''
760
+ );
 
761
  break;
762
  /**
763
  * handle `button` field type
1745
  'file' => 'jquery-ui.min.css',
1746
  ),
1747
  array(
1748
+ 'handle' => __CLASS__,
1749
+ 'file' => 'common.js',
1750
+ 'deps' => array( 'jquery', 'switch_button', 'jquery-ui-tabs' ),
1751
+ 'wp_localize_script' => array(
1752
+ 'buttons' => array(
1753
+ 'select_media' => __( 'Select Image', 'sierotki' ),
1754
+ ),
1755
+ ),
1756
  ),
1757
  /**
1758
  * switch checkbox
languages/sierotki.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Orphans PLUGIN_VERSION\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/sierotki\n"
7
- "POT-Creation-Date: 2022-01-19 16:12:42+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -208,44 +208,40 @@ msgstr ""
208
  msgid "<a href=\"http://iworks.pl/en/\" target=\"_blank\">break the web</a>"
209
  msgstr ""
210
 
211
- #: includes/iworks/class-iworks-orphan.php:404
212
  #: includes/iworks/rate/rate.php:118
213
  msgid "Settings"
214
  msgstr ""
215
 
216
- #: includes/iworks/class-iworks-orphan.php:416
217
- msgid "Donate"
218
- msgstr ""
219
-
220
- #: includes/iworks/class-iworks-orphan.php:566
221
  msgid "Integrations"
222
  msgstr ""
223
 
224
- #: includes/iworks/class-iworks-orphan.php:582
225
  msgid "Advanced Custom Fields"
226
  msgstr ""
227
 
228
- #: includes/iworks/class-iworks-orphan.php:587
229
  msgid "Text"
230
  msgstr ""
231
 
232
- #: includes/iworks/class-iworks-orphan.php:588
233
  msgid "Enabled the substitution of orphans in text fields."
234
  msgstr ""
235
 
236
- #: includes/iworks/class-iworks-orphan.php:596
237
  msgid "Textarea"
238
  msgstr ""
239
 
240
- #: includes/iworks/class-iworks-orphan.php:597
241
  msgid "Enabled the substitution of orphans in textarea fields. (Include WYSIWYG)."
242
  msgstr ""
243
 
244
- #: includes/iworks/class-iworks-orphan.php:605
245
  msgid "WYSIWYG"
246
  msgstr ""
247
 
248
- #: includes/iworks/class-iworks-orphan.php:606
249
  msgid "Enabled the substitution of orphans in WYSIWYG fields."
250
  msgstr ""
251
 
@@ -253,39 +249,40 @@ msgstr ""
253
  msgid "An error occurred while getting the configuration."
254
  msgstr ""
255
 
256
- #: includes/iworks/options/options.php:749
257
- msgid "Upload image"
 
258
  msgstr ""
259
 
260
- #: includes/iworks/options/options.php:755
261
  msgid "Delete image"
262
  msgstr ""
263
 
264
- #: includes/iworks/options/options.php:841
265
  msgid "Save Changes"
266
  msgstr ""
267
 
268
- #: includes/iworks/options/options.php:1645
269
  msgid "Country"
270
  msgstr ""
271
 
272
- #: includes/iworks/options/options.php:1646
273
  msgid "City"
274
  msgstr ""
275
 
276
- #: includes/iworks/options/options.php:1647
277
  msgid "Street"
278
  msgstr ""
279
 
280
- #: includes/iworks/options/options.php:1648
281
  msgid "ZIP code"
282
  msgstr ""
283
 
284
- #: includes/iworks/options/options.php:1799
285
  msgid "OFF"
286
  msgstr ""
287
 
288
- #: includes/iworks/options/options.php:1800
289
  msgid "ON"
290
  msgstr ""
291
 
4
  msgstr ""
5
  "Project-Id-Version: Orphans PLUGIN_VERSION\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/sierotki\n"
7
+ "POT-Creation-Date: 2022-01-20 20:06:35+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
208
  msgid "<a href=\"http://iworks.pl/en/\" target=\"_blank\">break the web</a>"
209
  msgstr ""
210
 
211
+ #: includes/iworks/class-iworks-orphan.php:403
212
  #: includes/iworks/rate/rate.php:118
213
  msgid "Settings"
214
  msgstr ""
215
 
216
+ #: includes/iworks/class-iworks-orphan.php:553
 
 
 
 
217
  msgid "Integrations"
218
  msgstr ""
219
 
220
+ #: includes/iworks/class-iworks-orphan.php:569
221
  msgid "Advanced Custom Fields"
222
  msgstr ""
223
 
224
+ #: includes/iworks/class-iworks-orphan.php:574
225
  msgid "Text"
226
  msgstr ""
227
 
228
+ #: includes/iworks/class-iworks-orphan.php:575
229
  msgid "Enabled the substitution of orphans in text fields."
230
  msgstr ""
231
 
232
+ #: includes/iworks/class-iworks-orphan.php:583
233
  msgid "Textarea"
234
  msgstr ""
235
 
236
+ #: includes/iworks/class-iworks-orphan.php:584
237
  msgid "Enabled the substitution of orphans in textarea fields. (Include WYSIWYG)."
238
  msgstr ""
239
 
240
+ #: includes/iworks/class-iworks-orphan.php:592
241
  msgid "WYSIWYG"
242
  msgstr ""
243
 
244
+ #: includes/iworks/class-iworks-orphan.php:593
245
  msgid "Enabled the substitution of orphans in WYSIWYG fields."
246
  msgstr ""
247
 
249
  msgid "An error occurred while getting the configuration."
250
  msgstr ""
251
 
252
+ #: includes/iworks/options/options.php:752
253
+ #: includes/iworks/options/options.php:1753
254
+ msgid "Select Image"
255
  msgstr ""
256
 
257
+ #: includes/iworks/options/options.php:757
258
  msgid "Delete image"
259
  msgstr ""
260
 
261
+ #: includes/iworks/options/options.php:843
262
  msgid "Save Changes"
263
  msgstr ""
264
 
265
+ #: includes/iworks/options/options.php:1647
266
  msgid "Country"
267
  msgstr ""
268
 
269
+ #: includes/iworks/options/options.php:1648
270
  msgid "City"
271
  msgstr ""
272
 
273
+ #: includes/iworks/options/options.php:1649
274
  msgid "Street"
275
  msgstr ""
276
 
277
+ #: includes/iworks/options/options.php:1650
278
  msgid "ZIP code"
279
  msgstr ""
280
 
281
+ #: includes/iworks/options/options.php:1806
282
  msgid "OFF"
283
  msgstr ""
284
 
285
+ #: includes/iworks/options/options.php:1807
286
  msgid "ON"
287
  msgstr ""
288
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://ko-fi.com/iworks?utm_source=sierotki&utm_medium=readme-dona
4
  Tags: sierotka, sierotki, spójniki, twarda spacja
5
  Requires at least: 4.6
6
  Tested up to: 5.9
7
- Stable tag: 2.9.2
8
 
9
  Plugin supports some of the grammatical rules of the Polish language.
10
 
@@ -126,7 +126,11 @@ function remove_iworks_orphan_terms( $terms ) {
126
 
127
  == Changelog ==
128
 
129
- = 2.9.2 - 2022-01-20 =
 
 
 
 
130
  * Updated iWorks Options to 2.7.3.
131
  * Updated iWorks Rate to 2.0.6.
132
 
4
  Tags: sierotka, sierotki, spójniki, twarda spacja
5
  Requires at least: 4.6
6
  Tested up to: 5.9
7
+ Stable tag: 2.9.3
8
 
9
  Plugin supports some of the grammatical rules of the Polish language.
10
 
126
 
127
  == Changelog ==
128
 
129
+ = 2.9.3 - 2022-01-20 =
130
+ * Removed doubled "Donate" link on plugin page.
131
+ * Updated iWorks Options to 2.8.0.
132
+
133
+ = 2.9.2 - 2022-01-19 =
134
  * Updated iWorks Options to 2.7.3.
135
  * Updated iWorks Rate to 2.0.6.
136
 
sierotki.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://iworks.pl/2011/02/16/sierotki/
5
  Text Domain: sierotki
6
  Description: Implement Polish grammar rules with orphans.
7
  Author: Marcin Pietrzak
8
- Version: 2.9.2
9
  Author URI: http://iworks.pl/
10
  */
11
 
5
  Text Domain: sierotki
6
  Description: Implement Polish grammar rules with orphans.
7
  Author: Marcin Pietrzak
8
+ Version: 2.9.3
9
  Author URI: http://iworks.pl/
10
  */
11