Hi,
Can you add a settings feature to enable minimum and maximum words count restrictions in the post editor, kindly note that im using the medium editor.
Recently some of my site members have been submitting low quality content with just 25 words or less, this feature will help to direct human spammers creating low quality content with few words. Restricting and preventing users from publishing until their post has a minimum threshold of 400 words would be very helpful.
when the user clicks the publish button a popup notification should appear showing the message (Your post must have a minimum of 400 words)
Thanks
Hello Tosin,
Thank you for posting and suggesting this feature. We will include this feature in future versions. For now, You can use the following code to prevent users from publishing content less than 400 words.
add_filter( 'bblpro_validation_errors', function ( $errors, $data ) { if ( $errors->has_errors() ) { return $errors; } $content = empty( $data['bbl_post_content'] ) ? '' : $data['bbl_post_content']; $words_count = (int) str_word_count( $content ); if ( $words_count < 400 ) { $errors->add( 'bbl_post_content', _x( 'Minimum 400 words required to publish.', 'Post form validation message', 'buddyblog-pro' ) ); } return $errors; }, 10, 2 );
Please let me know if this helps you or not.
Regards
Ravi
The topic ‘ [Resolved] Buddyblog min and max words’ is closed to new replies.