Changeset 727531
- Timestamp:
- 06/17/2013 04:18:53 PM (13 years ago)
- Location:
- rich-tax-description-editor/trunk
- Files:
-
- 2 edited
-
main.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
rich-tax-description-editor/trunk/main.php
r489040 r727531 68 68 return $description; 69 69 } 70 71 // truncate term description 72 function f_10_3__get_terms($terms, $taxonomies, $args) 73 { 74 global $pagenow; 75 if (is_admin() && $pagenow == 'edit-tags.php' && !isset($_REQUEST['action'])) { // detect taxonomy list page 76 foreach ($terms as &$term) { 77 $term->description = $this->to_plain_text($term->description); 78 } 79 } 80 return $terms; 81 } 82 83 private function to_plain_text($text) 84 { 85 $text = strip_shortcodes( $text ); 86 $text = apply_filters('the_content', $text); 87 $text = str_replace(']]>', ']]>', $text); 88 $text = wp_trim_words( $text, 12, '...' ); 89 return $text; 90 } 70 91 } 71 92 -
rich-tax-description-editor/trunk/readme.txt
r489040 r727531 37 37 = 1.0 = 38 38 Initial release. 39 40 = 1.1 = 41 Fix undefined notices. 42 Truncate description on listing pages.
Note: See TracChangeset
for help on using the changeset viewer.