[wp-hackers] Perhaps OT PHP Question

Chris Williams chris at clwill.com
Mon May 28 23:34:30 GMT 2007

This is a rudimentary question, I'm sure... But I am beating my head against
the wall.

I have a trivial plug-in thus:

function shakes_get_cat ($categories, $r) {
    if ('list' == $r['style']) {
        foreach ($categories as $category) {
            if (ctype_digit(substr($category->cat_name, 0, 2))) {
                $category->cat_name = $category->category_description;
    return $categories;
add_filter('get_categories', 'shakes_get_cat', 10, 2);

On my local test machine (php 5.2, wp 2.2) it works perfectly.  On the
server (php 4.?, wp 2.2) it doesn't.  The $categories array is unchanged.

Any help?  I know this is something obvious, but...


More information about the wp-hackers mailing list