GeoDirectory SupportMinimum Length review – GeoDirectory Support https://wpgeodirectory.com/support/topic/minimum-length-review/feed Thu, 25 Dec 2025 17:37:40 +0000 http://bbpress.org/?v=2.5.14-6684 en-US https://wpgeodirectory.com/support/topic/minimum-length-review/#post-44199 <![CDATA[Minimum Length review]]> https://wpgeodirectory.com/support/topic/minimum-length-review/#post-44199 Tue, 30 Jun 2015 15:24:22 +0000 giacomo Hi all,

i would like to have reviews of a MINIMUM (not max) length of 180 characters.

Anyone knows a plugin that can help me?

Maurizio S.

]]>
https://wpgeodirectory.com/support/topic/minimum-length-review/#post-44204 <![CDATA[Reply To: Minimum Length review]]> https://wpgeodirectory.com/support/topic/minimum-length-review/#post-44204 Tue, 30 Jun 2015 15:45:53 +0000 Paolo Hi,

the only plugin I ever heard about for this is https://wordpress.org/plugins/minimum-comment-length/ from Yoast.

However it appears to be working only with the default wordpress comment function is used, if you use a walker function like we do, apparently it doesn’t work.

Personally I haven’t tested it.

Let us know how you went,

Thanks

]]>
https://wpgeodirectory.com/support/topic/minimum-length-review/#post-44205 <![CDATA[Reply To: Minimum Length review]]> https://wpgeodirectory.com/support/topic/minimum-length-review/#post-44205 Tue, 30 Jun 2015 15:46:16 +0000 Simone Ciao,
add the following code to your functions.php inside your child theme’s folder


add_filter( 'preprocess_comment', 'commentominimo' );
   
 function commentominimo( $commentdata ) {
      $commentominimo = 180;
   
      if ( strlen( trim( $commentdata['comment_content'] ) ) < $commentominimo ){
      wp_die( 'La recensione deve avere un minimo di ' . $commentominimo . ' caratteri.' );
      }
  
      return $commentdata;
      }
]]>
https://wpgeodirectory.com/support/topic/minimum-length-review/#post-44207 <![CDATA[Reply To: Minimum Length review]]> https://wpgeodirectory.com/support/topic/minimum-length-review/#post-44207 Tue, 30 Jun 2015 15:49:30 +0000 Paolo Simone was way better than me on this one… 🙂

]]>
https://wpgeodirectory.com/support/topic/minimum-length-review/#post-44208 <![CDATA[Reply To: Minimum Length review]]> https://wpgeodirectory.com/support/topic/minimum-length-review/#post-44208 Tue, 30 Jun 2015 15:52:23 +0000 giacomo Thanks
a lot 😀

]]>
https://wpgeodirectory.com/support/topic/minimum-length-review/#post-44335 <![CDATA[Reply To: Minimum Length review]]> https://wpgeodirectory.com/support/topic/minimum-length-review/#post-44335 Wed, 01 Jul 2015 14:39:50 +0000 giacomo Update:

I’ve tried this code but unfortunately it doesn’t work… can you suggest something else?

thanks

]]>
https://wpgeodirectory.com/support/topic/minimum-length-review/#post-44336 <![CDATA[Reply To: Minimum Length review]]> https://wpgeodirectory.com/support/topic/minimum-length-review/#post-44336 Wed, 01 Jul 2015 14:43:01 +0000 Paolo Hi,

Simone said he tested it and it was working for him, are you sure you are adding it correctly?

Let us know,

Thx

]]>
https://wpgeodirectory.com/support/topic/minimum-length-review/#post-44339 <![CDATA[Reply To: Minimum Length review]]> https://wpgeodirectory.com/support/topic/minimum-length-review/#post-44339 Wed, 01 Jul 2015 14:47:51 +0000 Simone It is a tested code, so if you’re pasting it in the right way (in the functions.php, inside your child theme’s folder), it must work 🙂

You can test it here
http://test.simonetambasco.com/gd/annunci/italy/calabria/catanzaro/device

]]>
https://wpgeodirectory.com/support/topic/minimum-length-review/#post-45888 <![CDATA[Reply To: Minimum Length review]]> https://wpgeodirectory.com/support/topic/minimum-length-review/#post-45888 Thu, 16 Jul 2015 10:30:14 +0000 giacomo OK IT WORK PERFECTLY! thanks a lot.

i would like to redirect the user back to the listing page with two options:
1- after a couple of seconds he is automatically redirected
2- with a “back” button

i modified the working php code but it seems not to work…


add_filter( 'preprocess_comment', 'commentominimo' );
   
 function commentominimo( $commentdata ) {
      $commentominimo = 180;
   
      if ( strlen( trim( $commentdata['comment_content'] ) ) < $commentominimo ){
      wp_die( 'La recensione deve avere un minimo di ' . $commentominimo . ' caratteri.' );
      
      header("Location: {$_SERVER['HTTP_REFERER']}");
      exit;
      }
     return $commentdata;

      }

Thanks

]]>
https://wpgeodirectory.com/support/topic/minimum-length-review/#post-45901 <![CDATA[Reply To: Minimum Length review]]> https://wpgeodirectory.com/support/topic/minimum-length-review/#post-45901 Thu, 16 Jul 2015 12:25:45 +0000 Simone Hi, im not sure the page sends a referrer, thats why it isn’t working. You can try with a back button, as explained here
http://www.w3schools.com/jsref/met_his_back.asp

]]>