WordPress 2.7 Almost Broke this Site

flowerMy hosting service just told me to update to WordPress 2.7 — as the previous version had known security holes. So I did, and after I upgraded, the blog itself broke.

Just after the first post on the front page, there was a nasty error message:

Fatal error: Only variables can be passed by reference in .../functions.php on line ...

Fortunately, some googling gave me the answer. There is a one-line computation apparently pretty common in WordPress theme code that has to be broken out across two lines, suddenly.

From

    function comment_count($count) {
        global $id;
        $comments_by_type = &separate_comments(get_comments('post_id=' . $id));
        return count($comments_by_type['comment']);
    }

To

    function comment_count($count) {
        global $id;
        $get_comments= get_comments('post_id=' . $id);
        $comments_by_type = &separate_comments($get_comments);
        return count($comments_by_type['comment']);
    }

I have no idea about php etc, but this does seem to work. Thanks to wordpress support.

1 thought on “WordPress 2.7 Almost Broke this Site”

Leave a Reply

Your email address will not be published. Required fields are marked *