Changeset 2032298
- Timestamp:
- 02/16/2019 08:41:11 PM (7 years ago)
- File:
-
- 1 edited
-
greentext/trunk/greentext.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
greentext/trunk/greentext.php
r2032169 r2032298 5 5 * Plugin Name: Greentext 6 6 * Plugin URI: https://wordpress.org/plugins/greentext/ 7 * Description: Enables >greentexting in Wordpress comments. The plugin adds a span with the style color:green to comment lines that start with the ">" character. The span also has a class name of "greentext" in case you want to give it a different style in your CSS.8 * Version: 1.0 7 * Description: Enables >greentexting in comments, posts, and pages. The greentext can be customized via CSS or left default green. 8 * Version: 1.0.1 9 9 * Author: swack 10 10 * Author URI: https://twitter.com/swack … … 28 28 foreach($lines as $line) 29 29 { 30 $treated .= substr($line, 0, 4) == ">" ? '<span style="color:green" class="greentext">' . $line . '</span>' : $line; 30 $treated .= substr($line, 0, 1) == ">" ? '<span class="greentext" style="color:green;">' . $line . '</span>' : substr($line, 0, 4) == ">" ? '<span class="greentext" style="color:green;">' . $line . '</span>' : $line; 31 $treated .= PHP_EOL; 31 32 } 32 33 … … 34 35 } 35 36 37 // Applies greentext to comments 36 38 add_action('comment_text', 'greentext', 1); 39 40 // Applies greentext to posts and pages 41 add_action('the_content', 'greentext', 1); 42 37 43 ?>
Note: See TracChangeset
for help on using the changeset viewer.