Vintage socket photo by porah
I was looking for a WordPress plugin for code syntax highlighting that would work in the legacy WordPress 2.0 branch and discovered WP-Syntax which promised to do the trick.
The system requirements say
- Requires WordPress Version: 2.0 or higher
- Compatible up to: 2.7
Except that when installed on a WordPress 2.0.11 installation it threw up an error:
Fatal error: Call to undefined function do_action_ref_array() in \blog\wp-content\plugins\wp-syntax\wp-syntax.php on line 106
Tweaking required
It looks like that plugin doesn’t work in WordPress 2.0.x without a little tweaking. The exceptional WordPress Codex came to the rescue — if only all content management system documentation was that good.
This function is identical to do_action
So I tweaked the code and removed:
do_action_ref_array('wp_syntax_init_geshi', array(&$geshi));
and replaced it with
do_action('wp_syntax_init_geshi', array(&$geshi));
and lo and behold it worked!
I wondered why you were looking for a plugin for the legacy branch until I viewed source – you still run this on 2.0?!
Didn’t you update? At some point in the last year, I was sure you posted about upgrading to 2.4?
My current web host can’t support the requirements for anything above WordPress 2.0.11
My current host (WebFusion) offers:
WordPress 2.7 requires:
It’s let down with the MySQL support. Hence my recent tweet about looking to move to another web host.
Technically, I could move to a different hosting package with WebFusion but I’d lose 2 databases!
G