Strip of HTML and cut a piece of text, either by character or word count.
| Author: | Rodrigo Lanas van Lamoen (profile at wordpress.org) |
| WordPress version required: | 2.0 |
| WordPress version tested: | 3.1.4 |
| Plugin version: | 1.2.0 |
| Added to WordPress repository: | 16-03-2011 |
| Last updated: | 16-03-2011
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
|
| Rating, %: | 0 |
| Rated by: | 0 |
| Plugin URI: | http://p.contraculto.com/cleancut |
| Total downloads: | 849 |
![]() Click to start download |
|
A couple of simple php functions that, when passed a string of text and a length value, strips the text of html tags and markup, and cuts it to the specified length.
clencut_w returns the given number of words or less, cleancut_c returns given number of characters or less. Only complete words are returned.
They can be called as cleancut_w($string,$length) and cleancut_c($string,$length=50) from any template file.
Example: <?php $text_clean = cleancut_w($sometext,50); echo $text_clean; ?>.
