Optin Forms - Version 1.2.2

Version Description

Download this release

Release Info

Developer FancyThemes
Plugin Icon 128x128 Optin Forms
Version 1.2.2
Comparing to
See all releases

Code changes from version 1.2.1 to 1.2.2

Files changed (1) hide show
  1. includes/functions-forms.php +15 -2
includes/functions-forms.php CHANGED
@@ -242,13 +242,26 @@ function optinforms_create_form() {
242
 
243
  /**
244
  * Removes filters from excerpts.
 
 
 
 
 
 
 
 
 
 
 
245
  */
246
- function optinforms_remove_from_excerpt() {
247
  remove_filter( "the_content", "optinform_insert_form_first_paragraph_post" );
248
  remove_filter( "the_content", "optinform_insert_form_first_paragraph_page" );
249
  remove_filter( "the_content", "optinform_insert_form_second_paragraph_post" );
250
  remove_filter( "the_content", "optinform_insert_form_second_paragraph_page" );
251
  remove_filter( "the_content", "optinforms_insert_form_after_post" );
252
  remove_filter( "the_content", "optinforms_insert_form_after_page" );
 
 
253
  }
254
- add_filter( 'get_the_excerpt', 'optinforms_remove_from_excerpt', 1 );
242
 
243
  /**
244
  * Removes filters from excerpts.
245
+ *
246
+ * This was intended to prevent the optin form from being disaplyed during or
247
+ * after excerpts. However, users were reporting that it was having a broader
248
+ * impact than intended, so I (@alexmansfield) disabled it. Examples of user
249
+ * struggles are listed below:
250
+ *
251
+ * @see https://wordpress.org/support/topic/forms-not-showing-upvia-form-placement-option?replies=1
252
+ * @see https://wordpress.org/support/topic/cant-get-the-form-back-after-the-plugin-was-desabled?replies=1
253
+ *
254
+ * @param string $excerpt The post excerpt
255
+ * @return string $excerpt The post excerpt
256
  */
257
+ function optinforms_remove_from_excerpt( $excerpt ) {
258
  remove_filter( "the_content", "optinform_insert_form_first_paragraph_post" );
259
  remove_filter( "the_content", "optinform_insert_form_first_paragraph_page" );
260
  remove_filter( "the_content", "optinform_insert_form_second_paragraph_post" );
261
  remove_filter( "the_content", "optinform_insert_form_second_paragraph_page" );
262
  remove_filter( "the_content", "optinforms_insert_form_after_post" );
263
  remove_filter( "the_content", "optinforms_insert_form_after_page" );
264
+
265
+ return $excerpt;
266
  }
267
+ // add_filter( 'get_the_excerpt', 'optinforms_remove_from_excerpt', 1 );