Provides a configurable limit on the length of comments left in the comment form, with a dynamically updated character count displayed for the user.
NOTE: Please do NOT use the WordPress forums to seek support for this plugin. Support for GCLL is handled on our own site.
comments.phpwith one or two function calls, as described below
With just a single line of code -- or none at all -- most themes will support the comment length limit provided by this plugin. (Note that themes must include the
wp_footer() call in order for this plugin -- and many others out there -- to work correctly.)
WordPress 3.0 and Themes Using the New Comment Form Function
Under WordPress 3.0 and later, the entire comment form can be generated via a single call to the function
comment_form(). If your theme uses the new
comment_form, this plugin can automatically tweak the form so comments can be counted. The plugin filters the
comment_field default and inserts the countdown box just after the
label tag for the comment area. If you'd rather position the countdown box yourself, you can do so by tapping into any of the standard comment form filters and inserting the value returned by
If your theme does not use the new 3.0 functionality, please use the instructions in the following section.
WordPress 2.9.2 and Earlier, And 3.0+ Themes Without the New Comment Form Functionality
Preparing your comment form for length limiting is still very straightforward:
<?php gcll_tweak_textarea(); ?>
For example, here is how the WordPress 2.7 default theme's comment textarea looks after updating the tag to support Greg's Comment Length Limiter plugin:
<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4" <?php if (function_exists('gcll_tweak_textarea')) gcll_tweak_textarea(); ?>></textarea></p>
Optionally, if you would like to position the countdown box yourself, add the following function call wherever you would like the box to appear within your comment form, again preferably wrapped in a conditional that tests whether the function exists:
<?php gcll_show_limit_box_manually(); ?>
The plugin settings page allows you to specify whether you would like the plugin to place the countdown box automatically, or whether you would prefer to do that yourself. If you specify that the plugin should place the countdown box automatically, that setting will apply even if you also include manual placement code within your theme -- in other words, the plugin is intelligent enough not to attempt to do it twice. So, if you'd like to compare your placement with the default placement, you can flip the manual placement setting on and off and view the results, without repeatedly adding and deleting the call from your theme.
Manual Positioning Via Direct Calls
For styling purposes, manual calls to display the countdown box, using
<?php gcll_show_limit_box_manually(); ?> or
<?php gcll_show_limit_box_for_filtering(); ?>, can also take one parameter specifying your preferred class for the
<span> which encloses the box:
<?php gcll_show_limit_box_manually('mypreferredclass'); ?>.
<span> class is
Safe Wrapping of Plugin-Dependent Function Calls
I cover safe wrapping of plugin-dependent function calls on the Greg's Plugins FAQ.
You can deactivate Greg's Comment Length Limiter plugin via the plugins administration page, and your preferences will be saved for the next time you enable it.
However, if you would like to remove the plugin completely, just disable it via the plugins administration page, then select it from the list of recently deactivated plugins and choose "Delete" from the admin menu. This will not only delete the plugin, but it will also run a special routine included with the plugin which will completely remove its preferences from the database.
Requires: 2.7 or higher
Compatible up to: 4.6.1
Last Updated: 2 months ago
Active Installs: 1,000+
Got something to say? Need help?