Ticket #667 (closed enhancement: fixed)
Support init hook for geshi settings
| Reported by: | rmm5t | Owned by: | rmm5t |
|---|---|---|---|
| Priority: | normal | Component: | wp-syntax |
| Severity: | normal | Keywords: | |
| Cc: |
Description
reedom had a great idea to incorporate an initialization hook to set geshi settings outside of wp-syntax.
Change History
Note: See
TracTickets for help on using
tickets.

For posterity, the original post from reedom:
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;'); }