add a hook to wp-syntax to enable changing syntax colors
-
To give a chance to blog owners to change Geshi’s coloring or other behavior, how about add a hook like:
*** /home/trac/www/wordpress/wp-content/plugins/wp-syntax/wp-syntax.php~ Tue May 29 06:45:16 2007 --- /home/trac/www/wordpress/wp-content/plugins/wp-syntax/wp-syntax.php Fri Jul 6 17:52:13 2007 *************** *** 73,78 **** --- 73,79 ---- $geshi = new GeSHi($code, $language); $geshi->enable_keyword_links(false); + do_action_ref_array('wp-syntax-init-geshi', array(&$geshi)); $output = "\n<div class=\"wp_syntax\">";
So blog owners can handle the hook in a hand-made plugin or somewhere else like this:
add_action('wp-syntax-init-geshi', 'wpsc_change_styles'); function wpsc_change_styles(&$geshi) { $geshi->set_brackets_style('color: #000;'); $geshi->set_keyword_group_style(1, 'color: #22f;'); }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘add a hook to wp-syntax to enable changing syntax colors’ is closed to new replies.