Orphans - Version 2.9.1

Version Description

  • 2021-12-09 =
  • Added integration with "Advanced Custom Fields" for fields types: "text", "textarea", "WYSIWYG". Props for Kamil Lipiski for the tests.
Download this release

Release Info

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

Code changes from version 2.9.0 to 2.9.1

includes/iworks/class-iworks-orphan.php CHANGED
@@ -68,6 +68,7 @@ class iworks_orphan {
68
  * filters
69
  */
70
  add_filter( 'orphan_replace', array( $this, 'orphan_replace_filter' ) );
 
71
  /**
72
  * iWorks Rate Class
73
  */
@@ -355,6 +356,16 @@ class iworks_orphan {
355
  * @since 2.7.0
356
  */
357
  add_filter( 'get_post_metadata', array( $this, 'filter_post_meta' ), 10, 4 );
 
 
 
 
 
 
 
 
 
 
358
  }
359
 
360
  /**
@@ -551,4 +562,56 @@ class iworks_orphan {
551
  return $logo;
552
  }
553
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
554
  }
68
  * filters
69
  */
70
  add_filter( 'orphan_replace', array( $this, 'orphan_replace_filter' ) );
71
+ add_filter( 'orphang_indicator_options', array( $this, 'add_integrations' ) );
72
  /**
73
  * iWorks Rate Class
74
  */
356
  * @since 2.7.0
357
  */
358
  add_filter( 'get_post_metadata', array( $this, 'filter_post_meta' ), 10, 4 );
359
+ /**
360
+ * Integrations: Advanced Custom Fields
361
+ *
362
+ * @since 2.9.1
363
+ */
364
+ foreach ( array( 'text', 'textarea', 'wysiwyg' ) as $type ) {
365
+ if ( $this->is_on( 'acf_' . $type ) ) {
366
+ add_filter( 'acf/format_value/type=' . $type, array( $this, 'replace' ) );
367
+ }
368
+ }
369
  }
370
 
371
  /**
562
  return $logo;
563
  }
564
 
565
+ private function add_integration_header( $options ) {
566
+ $label = __( 'Integrations', 'sierotki' );
567
+ $options['index']['options'][] = array(
568
+ 'type' => 'heading',
569
+ 'label' => $label,
570
+ );
571
+ return $options;
572
+ }
573
+
574
+ public function add_integrations( $options ) {
575
+ $added = false;
576
+ if ( class_exists( 'ACF' ) ) {
577
+ if ( ! $added ) {
578
+ $options = $this->add_integration_header( $options );
579
+ $added = true;
580
+ $options['index']['options'][] = array(
581
+ 'type' => 'subheading',
582
+ 'label' => __( 'Advanced Custom Fields', 'sierotki' ),
583
+ );
584
+ $options['index']['options'][] = array(
585
+ 'name' => 'acf_text',
586
+ 'type' => 'checkbox',
587
+ 'th' => __( 'Text', 'sierotki' ),
588
+ 'description' => __( 'Enabled the substitution of orphans in text fields.', 'sierotki' ),
589
+ 'sanitize_callback' => 'absint',
590
+ 'default' => 0,
591
+ 'classes' => array( 'switch-button' ),
592
+ );
593
+ $options['index']['options'][] = array(
594
+ 'name' => 'acf_textarea',
595
+ 'type' => 'checkbox',
596
+ 'th' => __( 'Textarea', 'sierotki' ),
597
+ 'description' => __( 'Enabled the substitution of orphans in textarea fields. (Include WYSIWYG).', 'sierotki' ),
598
+ 'sanitize_callback' => 'absint',
599
+ 'default' => 0,
600
+ 'classes' => array( 'switch-button' ),
601
+ );
602
+ $options['index']['options'][] = array(
603
+ 'name' => 'acf_wysiwyg',
604
+ 'type' => 'checkbox',
605
+ 'th' => __( 'WYSIWYG', 'sierotki' ),
606
+ 'description' => __( 'Enabled the substitution of orphans in WYSIWYG fields.', 'sierotki' ),
607
+ 'sanitize_callback' => 'absint',
608
+ 'default' => 0,
609
+ 'classes' => array( 'switch-button' ),
610
+ );
611
+ }
612
+ }
613
+
614
+ return $options;
615
+ }
616
+
617
  }
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-12-09 15:37:28+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -184,39 +184,71 @@ msgstr ""
184
  msgid "WordPress Help Forum"
185
  msgstr ""
186
 
187
- #: includes/iworks/class-iworks-orphan.php:280
188
  msgid "Plugin fix some Polish gramary rules with orphans."
189
  msgstr ""
190
 
191
- #: includes/iworks/class-iworks-orphan.php:287
192
  msgid "For more information:"
193
  msgstr ""
194
 
195
- #: includes/iworks/class-iworks-orphan.php:288
196
  msgid ""
197
  "<a href=\"http://wordpress.org/extend/plugins/sierotki/\" "
198
  "target=\"_blank\">Plugin Homepage</a>"
199
  msgstr ""
200
 
201
- #: includes/iworks/class-iworks-orphan.php:289
202
  msgid ""
203
  "<a href=\"http://wordpress.org/support/plugin/sierotki/\" "
204
  "target=\"_blank\">Support Forums</a>"
205
  msgstr ""
206
 
207
- #: includes/iworks/class-iworks-orphan.php:290
208
  msgid "<a href=\"http://iworks.pl/en/\" target=\"_blank\">break the web</a>"
209
  msgstr ""
210
 
211
- #: includes/iworks/class-iworks-orphan.php:393
212
  #: includes/iworks/rate/rate.php:111
213
  msgid "Settings"
214
  msgstr ""
215
 
216
- #: includes/iworks/class-iworks-orphan.php:405
217
  msgid "Donate"
218
  msgstr ""
219
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  #: includes/iworks/options/options.php:237
221
  msgid "An error occurred while getting the configuration."
222
  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-12-15 10:26:41+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
184
  msgid "WordPress Help Forum"
185
  msgstr ""
186
 
187
+ #: includes/iworks/class-iworks-orphan.php:281
188
  msgid "Plugin fix some Polish gramary rules with orphans."
189
  msgstr ""
190
 
191
+ #: includes/iworks/class-iworks-orphan.php:288
192
  msgid "For more information:"
193
  msgstr ""
194
 
195
+ #: includes/iworks/class-iworks-orphan.php:289
196
  msgid ""
197
  "<a href=\"http://wordpress.org/extend/plugins/sierotki/\" "
198
  "target=\"_blank\">Plugin Homepage</a>"
199
  msgstr ""
200
 
201
+ #: includes/iworks/class-iworks-orphan.php:290
202
  msgid ""
203
  "<a href=\"http://wordpress.org/support/plugin/sierotki/\" "
204
  "target=\"_blank\">Support Forums</a>"
205
  msgstr ""
206
 
207
+ #: includes/iworks/class-iworks-orphan.php:291
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:111
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
+
252
  #: includes/iworks/options/options.php:237
253
  msgid "An error occurred while getting the configuration."
254
  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.9
7
- Stable tag: 2.9.0
8
 
9
  Plugin supports some of the grammatical rules of the Polish language.
10
 
@@ -126,6 +126,9 @@ function remove_iworks_orphan_terms( $terms ) {
126
 
127
  == Changelog ==
128
 
 
 
 
129
  = 2.9.0 - 2021-12-09 =
130
  * Added filter `iworks_orphan_own_terms_file` to add ability to change whole terms definition file.
131
  * Moved terms into `etc/terms.txt`.
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.1
8
 
9
  Plugin supports some of the grammatical rules of the Polish language.
10
 
126
 
127
  == Changelog ==
128
 
129
+ = 2.9.1 - 2021-12-09 =
130
+ * Added integration with "Advanced Custom Fields" for fields types: "text", "textarea", "WYSIWYG". Props for [Kamil Lipiński](https://profiles.wordpress.org/create24/) for the tests.
131
+
132
  = 2.9.0 - 2021-12-09 =
133
  * Added filter `iworks_orphan_own_terms_file` to add ability to change whole terms definition file.
134
  * Moved terms into `etc/terms.txt`.
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.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.9.1
9
  Author URI: http://iworks.pl/
10
  */
11