Orphans - Version 2.8.1

Version Description

  • 2021-11-26 =
  • Added a widget blocks content to replacements.
  • Added filter iworks_orphan_terms (old one has a typo iworks_orphan_therms - but old one stays too).
  • Improved filtering defaults orphans - now it is filtered when we get it, not only on init.
Download this release

Release Info

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

Code changes from version 2.8.0 to 2.8.1

etc/options.php CHANGED
@@ -93,6 +93,18 @@ function orphang_indicator_options() {
93
  'classes' => array( 'switch-button' ),
94
  'default' => 1,
95
  ),
 
 
 
 
 
 
 
 
 
 
 
 
96
  /**
97
  * Since 2.6.6
98
  */
93
  'classes' => array( 'switch-button' ),
94
  'default' => 1,
95
  ),
96
+ /**
97
+ * Since 2.8.1
98
+ */
99
+ array(
100
+ 'name' => 'widget_block_content',
101
+ 'th' => __( 'Widget block content', 'sierotki' ),
102
+ 'type' => 'checkbox',
103
+ 'description' => __( 'Enabled the substitution of orphans in the widget blocks.', 'sierotki' ),
104
+ 'sanitize_callback' => 'absint',
105
+ 'classes' => array( 'switch-button' ),
106
+ 'default' => 1,
107
+ ),
108
  /**
109
  * Since 2.6.6
110
  */
includes/iworks/orphan.php CHANGED
@@ -312,6 +312,7 @@ class iworks_orphan {
312
  'widget_text',
313
  'term_description',
314
  'get_the_author_description',
 
315
  );
316
  foreach ( $this->settings as $filter => $value ) {
317
  if ( ! in_array( $filter, $allowed_filters ) ) {
@@ -450,7 +451,10 @@ class iworks_orphan {
450
  */
451
  private function _terms() {
452
  if ( ! empty( $this->terms ) ) {
453
- return $this->terms;
 
 
 
454
  }
455
  $terms = array(
456
  'al.',
@@ -581,7 +585,6 @@ class iworks_orphan {
581
  $own_orphans = preg_replace( '/\,\+/', ',', $own_orphans );
582
  $terms = array_merge( $terms, preg_split( '/,[ \t]*/', strtolower( $own_orphans ) ) );
583
  }
584
- $terms = apply_filters( 'iworks_orphan_therms', $terms );
585
  /**
586
  * remove duplicates
587
  */
@@ -599,7 +602,12 @@ class iworks_orphan {
599
  */
600
  $terms = array_filter( $terms );
601
  $this->terms = $terms;
602
- return $this->terms;
 
 
 
 
 
603
  }
604
 
605
  /**
312
  'widget_text',
313
  'term_description',
314
  'get_the_author_description',
315
+ 'widget_block_content',
316
  );
317
  foreach ( $this->settings as $filter => $value ) {
318
  if ( ! in_array( $filter, $allowed_filters ) ) {
451
  */
452
  private function _terms() {
453
  if ( ! empty( $this->terms ) ) {
454
+ $terms = $this->terms;
455
+ $terms = apply_filters( 'iworks_orphan_therms', $terms );
456
+ $terms = apply_filters( 'iworks_orphan_terms', $terms );
457
+ return $terms;
458
  }
459
  $terms = array(
460
  'al.',
585
  $own_orphans = preg_replace( '/\,\+/', ',', $own_orphans );
586
  $terms = array_merge( $terms, preg_split( '/,[ \t]*/', strtolower( $own_orphans ) ) );
587
  }
 
588
  /**
589
  * remove duplicates
590
  */
602
  */
603
  $terms = array_filter( $terms );
604
  $this->terms = $terms;
605
+ /**
606
+ * filter it
607
+ */
608
+ $terms = apply_filters( 'iworks_orphan_therms', $terms );
609
+ $terms = apply_filters( 'iworks_orphan_terms', $terms );
610
+ return $terms;
611
  }
612
 
613
  /**
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: 2021-08-31 07:33:46+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -40,7 +40,7 @@ msgstr ""
40
  msgid "Post types"
41
  msgstr ""
42
 
43
- #: etc/options.php:34 etc/options.php:113
44
  msgid "Title"
45
  msgstr ""
46
 
@@ -92,87 +92,95 @@ msgstr ""
92
  msgid "Enabled the substitution of orphans in the widget text."
93
  msgstr ""
94
 
95
- #: etc/options.php:101 etc/options.php:106
 
 
 
 
 
 
 
 
96
  msgid "Taxonomies"
97
  msgstr ""
98
 
99
- #: etc/options.php:115
100
  msgid "Enabled the substitution of orphans in the taxonomy title."
101
  msgstr ""
102
 
103
- #: etc/options.php:122
104
  msgid "Description"
105
  msgstr ""
106
 
107
- #: etc/options.php:124
108
  msgid "Enabled the substitution of orphans in the taxonomy description."
109
  msgstr ""
110
 
111
- #: etc/options.php:131
112
  msgid "Miscellaneous"
113
  msgstr ""
114
 
115
- #: etc/options.php:139
116
  msgid "Author description"
117
  msgstr ""
118
 
119
- #: etc/options.php:140
120
  msgid "Enabled the substitution of orphans in the author description."
121
  msgstr ""
122
 
123
- #: etc/options.php:147
124
  msgid "Ignore language"
125
  msgstr ""
126
 
127
- #: etc/options.php:149
128
  msgid "Allow to use plugin with another languages then Polish."
129
  msgstr ""
130
 
131
- #: etc/options.php:156
132
  msgid "Keep numbers together"
133
  msgstr ""
134
 
135
- #: etc/options.php:158
136
  msgid "Allow to keep together phone number or strings with space between numbers."
137
  msgstr ""
138
 
139
- #: etc/options.php:164
140
  msgid "User definied orphans"
141
  msgstr ""
142
 
143
- #: etc/options.php:166
144
  msgid "Use a comma to separate orphans."
145
  msgstr ""
146
 
147
- #: etc/options.php:173
148
  msgid "Entries custom fields"
149
  msgstr ""
150
 
151
- #: etc/options.php:175
152
  msgid "Use a comma to separate custom fields name."
153
  msgstr ""
154
 
155
- #: etc/options.php:183 etc/options.php:242
156
  msgid "We are waiting for your message"
157
  msgstr ""
158
 
159
- #: etc/options.php:189
160
  msgid "I love what I do!"
161
  msgstr ""
162
 
163
- #: etc/options.php:206
164
  msgid "Below are some links to help spread this plugin to other users"
165
  msgstr ""
166
 
167
- #: etc/options.php:208
168
  msgid "Give it a five stars on WordPress.org"
169
  msgstr ""
170
 
171
- #: etc/options.php:209
172
  msgid "Link to it so others can easily find it"
173
  msgstr ""
174
 
175
- #: etc/options.php:244
176
  msgid "WordPress Help Forum"
177
  msgstr ""
178
 
@@ -240,11 +248,11 @@ msgstr ""
240
  msgid "<a href=\"http://iworks.pl/en/\" target=\"_blank\">break the web</a>"
241
  msgstr ""
242
 
243
- #: includes/iworks/orphan.php:384 includes/iworks/rate/rate.php:111
244
  msgid "Settings"
245
  msgstr ""
246
 
247
- #: includes/iworks/orphan.php:396
248
  msgid "Donate"
249
  msgstr ""
250
 
@@ -336,12 +344,12 @@ msgstr ""
336
  msgid "http://iworks.pl/"
337
  msgstr ""
338
 
339
- #: etc/options.php:209
340
  msgctxt "plugin home page on WordPress.org"
341
  msgid "https://wordpress.org/plugins/sierotki/"
342
  msgstr ""
343
 
344
- #: etc/options.php:244
345
  msgctxt "link to support forum on WordPress.org"
346
  msgid "https://wordpress.org/support/plugin/sierotki/"
347
  msgstr ""
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: 2021-11-26 10:41:25+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
40
  msgid "Post types"
41
  msgstr ""
42
 
43
+ #: etc/options.php:34 etc/options.php:125
44
  msgid "Title"
45
  msgstr ""
46
 
92
  msgid "Enabled the substitution of orphans in the widget text."
93
  msgstr ""
94
 
95
+ #: etc/options.php:101
96
+ msgid "Widget block content"
97
+ msgstr ""
98
+
99
+ #: etc/options.php:103
100
+ msgid "Enabled the substitution of orphans in the widget blocks."
101
+ msgstr ""
102
+
103
+ #: etc/options.php:113 etc/options.php:118
104
  msgid "Taxonomies"
105
  msgstr ""
106
 
107
+ #: etc/options.php:127
108
  msgid "Enabled the substitution of orphans in the taxonomy title."
109
  msgstr ""
110
 
111
+ #: etc/options.php:134
112
  msgid "Description"
113
  msgstr ""
114
 
115
+ #: etc/options.php:136
116
  msgid "Enabled the substitution of orphans in the taxonomy description."
117
  msgstr ""
118
 
119
+ #: etc/options.php:143
120
  msgid "Miscellaneous"
121
  msgstr ""
122
 
123
+ #: etc/options.php:151
124
  msgid "Author description"
125
  msgstr ""
126
 
127
+ #: etc/options.php:152
128
  msgid "Enabled the substitution of orphans in the author description."
129
  msgstr ""
130
 
131
+ #: etc/options.php:159
132
  msgid "Ignore language"
133
  msgstr ""
134
 
135
+ #: etc/options.php:161
136
  msgid "Allow to use plugin with another languages then Polish."
137
  msgstr ""
138
 
139
+ #: etc/options.php:168
140
  msgid "Keep numbers together"
141
  msgstr ""
142
 
143
+ #: etc/options.php:170
144
  msgid "Allow to keep together phone number or strings with space between numbers."
145
  msgstr ""
146
 
147
+ #: etc/options.php:176
148
  msgid "User definied orphans"
149
  msgstr ""
150
 
151
+ #: etc/options.php:178
152
  msgid "Use a comma to separate orphans."
153
  msgstr ""
154
 
155
+ #: etc/options.php:185
156
  msgid "Entries custom fields"
157
  msgstr ""
158
 
159
+ #: etc/options.php:187
160
  msgid "Use a comma to separate custom fields name."
161
  msgstr ""
162
 
163
+ #: etc/options.php:195 etc/options.php:254
164
  msgid "We are waiting for your message"
165
  msgstr ""
166
 
167
+ #: etc/options.php:201
168
  msgid "I love what I do!"
169
  msgstr ""
170
 
171
+ #: etc/options.php:218
172
  msgid "Below are some links to help spread this plugin to other users"
173
  msgstr ""
174
 
175
+ #: etc/options.php:220
176
  msgid "Give it a five stars on WordPress.org"
177
  msgstr ""
178
 
179
+ #: etc/options.php:221
180
  msgid "Link to it so others can easily find it"
181
  msgstr ""
182
 
183
+ #: etc/options.php:256
184
  msgid "WordPress Help Forum"
185
  msgstr ""
186
 
248
  msgid "<a href=\"http://iworks.pl/en/\" target=\"_blank\">break the web</a>"
249
  msgstr ""
250
 
251
+ #: includes/iworks/orphan.php:385 includes/iworks/rate/rate.php:111
252
  msgid "Settings"
253
  msgstr ""
254
 
255
+ #: includes/iworks/orphan.php:397
256
  msgid "Donate"
257
  msgstr ""
258
 
344
  msgid "http://iworks.pl/"
345
  msgstr ""
346
 
347
+ #: etc/options.php:221
348
  msgctxt "plugin home page on WordPress.org"
349
  msgid "https://wordpress.org/plugins/sierotki/"
350
  msgstr ""
351
 
352
+ #: etc/options.php:256
353
  msgctxt "link to support forum on WordPress.org"
354
  msgid "https://wordpress.org/support/plugin/sierotki/"
355
  msgstr ""
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.8
7
- Stable tag: 2.8.0
8
 
9
  Plugin supports some of the grammatical rules of the Polish language.
10
 
@@ -100,6 +100,23 @@ and at the end, to again turn on replacements:
100
  remove_filter( 'orphan_skip_replacement', '__return_true' );
101
  `
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  == Screenshots ==
104
 
105
  1. Options for entries.
@@ -109,6 +126,11 @@ remove_filter( 'orphan_skip_replacement', '__return_true' );
109
 
110
  == Changelog ==
111
 
 
 
 
 
 
112
  = 2.8.0 - 2021-08-31 =
113
  * Fixed conflict with some plugins. Props for Adam Gruntkowski.
114
  * Updated iWorks Rate to 2.0.4.
@@ -212,14 +234,14 @@ remove_filter( 'orphan_skip_replacement', '__return_true' );
212
  * Change language domain from `iworks_orphan` to plugin name `sierotki' to be compatible with i18n WordPress rules.
213
  * Added activate plugin hook to change options autoload status.
214
  * Added deactivate plugin hook to change options autoload status.
215
- * Added filter `iworks_orphans_capability`, Props for Cezary Buliszak.
216
  * Added non-breakable space after numbers.
217
  * Added uninstall plugin hook.
218
  * Update screenshots.
219
 
220
  = 2.5 - 2015-11-06 =
221
 
222
- * IMPROVEMENT: added filter `iworks_orphan_replace`
223
 
224
  = 2.4 - 2015-02-12 =
225
 
4
  Tags: sierotka, sierotki, spójniki, twarda spacja
5
  Requires at least: 4.6
6
  Tested up to: 5.8
7
+ Stable tag: 2.8.1
8
 
9
  Plugin supports some of the grammatical rules of the Polish language.
10
 
100
  remove_filter( 'orphan_skip_replacement', '__return_true' );
101
  `
102
 
103
+ = How can I change default orphans? =
104
+
105
+ Please use `iworks_orphan_terms` filter. It is array of default orphans. You can remove, add or even replace whole array. For example, to remove words "oraz", "na" and ""nie", use code bellow:
106
+
107
+ `
108
+ add_filter( 'iworks_orphan_terms', 'remove_iworks_orphan_terms' );
109
+ function remove_iworks_orphan_terms( $terms ) {
110
+ $default_orphans_to_remove = array( 'oraz', 'na', 'nie', );
111
+ foreach( $default_orphans_to_remove as $value ) {
112
+ if ( $key = array_search( $value, $terms ) ) {
113
+ unset( $terms[ $key ] );
114
+ }
115
+ }
116
+ return $terms;
117
+ }
118
+ `
119
+
120
  == Screenshots ==
121
 
122
  1. Options for entries.
126
 
127
  == Changelog ==
128
 
129
+ = 2.8.1 - 2021-11-26 =
130
+ * Added a widget blocks content to replacements.
131
+ * Added filter `iworks_orphan_terms` (old one has a typo `iworks_orphan_therms` - but old one stays too).
132
+ * Improved filtering defaults orphans - now it is filtered when we get it, not only on init.
133
+
134
  = 2.8.0 - 2021-08-31 =
135
  * Fixed conflict with some plugins. Props for Adam Gruntkowski.
136
  * Updated iWorks Rate to 2.0.4.
234
  * Change language domain from `iworks_orphan` to plugin name `sierotki' to be compatible with i18n WordPress rules.
235
  * Added activate plugin hook to change options autoload status.
236
  * Added deactivate plugin hook to change options autoload status.
237
+ * Added filter `iworks_orphans_capability`, Props for Cezary Buliszak.
238
  * Added non-breakable space after numbers.
239
  * Added uninstall plugin hook.
240
  * Update screenshots.
241
 
242
  = 2.5 - 2015-11-06 =
243
 
244
+ * IMPROVEMENT: added filter `iworks_orphan_replace`
245
 
246
  = 2.4 - 2015-02-12 =
247
 
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.8.0
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.8.1
9
  Author URI: http://iworks.pl/
10
  */
11