WordPress and PHP 5.3.x: update_comment_type_cache() expected to be a reference

I upgraded a Fedora 11 instance to Fedora 12 and found the following error at the top of one of my WordPress blogs:

Parameter 1 to update_comment_type_cache() expected to be a reference, 
value given in wp-includes/plugin.php on line 166

The problem wasn't in a plugin, actually. It was within my theme's (R755-light) functions.php:

function update_comment_type_cache(&$queried_posts) {

The temporary fix is to remove the & from that line so it looks like this:

function update_comment_type_cache($queried_posts) {

After clearing out the WP Super Cache, the page was loading properly again. It turns out that the function actually calculates how many comments are available for a given post, so that functionality is working properly right now. A few theme authors are already releasing new versions to fix this bug, but my theme's author has not.

The credit for the fix goes to someone in the WordPress forums.

Printed from: http://rackerhacker.com/2009/12/21/wordpress-and-php-5-3-x-update_comment_type_cache-expected-to-be-a-reference/ .
© Major Hayden 2012.

17 Comments   »

  • BLoodroSE says:

    yes this is work perfectly
    thanks :D

  • C says:

    My problem is a little different

    Warning: include_once(V:\xampp\htdocs\blog/wp-includes/pomo/mo.php) [function.include-once]: failed to open stream: No such file or directory in V:\xampp\htdocs\blog\wp-settings.php on line 342

    Warning: include_once() [function.include]: Failed opening 'V:\xampp\htdocs\blog/wp-includes/pomo/mo.php' for inclusion (include_path='.;V:\xampp\php\PEAR') in V:\xampp\htdocs\blog\wp-settings.php on line 342

    Warning: require(V:\xampp\htdocs\blog/wp-includes/meta.php) [function.require]: failed to open stream: No such file or directory in V:\xampp\htdocs\blog\wp-settings.php on line 364

  • C says:

    Any ideas ?

  • A Gift says:

    Cool! It's working now. Thank you.

  • thank,
    it's really help me

  • Ryan Cullen says:

    Had a similar issue, except that the PHP errors weren't being reported on the blog I was running for a friend. Just kept getting "No posts found".
    Having disabled all the plugins, restored an old backup of the posts, I tried the create a brand new hosting account. Imported the posts and everything was fine. Install the R755 theme and posts have gone again, except this time the new hosting account gave the PHP error. A quick google search lead me to this post and 2 seconds later the blog is working again.

    Many thanks.

  • bigal says:

    This corrected my issue with my new theme. Thanks.

  • lizchase says:

    thank YOUUUUUUUUU ~ i have been looking for this for weeks! just removing the (&) did the trick!!!!!!

    i'm sooo excited, thank you so very much!

  • Matt says:

    I also had this exact problem with the r755 theme and no posts or pages loading in either the website or the admin dashboard. Updating functions.php with this fix resolved all the problems for me straight away. This was after migrating to a new web hosting server where I had upgraded to php5.3 - so THANK YOU for this great fix. It resolved all the problems immediately.

  • Great information, i've been this info for the last 2 weeks. Keep up the good work.

  • Raj says:

    I have warning msg: Warning: Parameter 1 to update_comment_type_cache() expected to be a reference, value given in C:\xampp\htdocs\gstindiablog\wp-includes\plugin.php on line 166

    But we can create Manual theme for mysite in this no lines like function update_comment_type_cache(&$queried_posts) { .......... what can i do....... Thanking you

  • ping says:

    thanks a lot!

    it's really help me.

  • Raj says:

    I also have the same problem i use xampp 1.7.4 and wordpress 2.9.2

  • Kevin says:

    Thanks for this, great help =)

  • My brother suggested I might like this web site. He used to be totally right. This put up truly made my day. You cann't imagine simply how so much time I had spent for this information! Thanks!

  • Gracias!
    Thank you so very much!

  • Becky says:

    I know this post was written a while ago, but I am using an older theme (simplebalance) and your easy fix has saved me tearing my hair out this evening. Many thanks!

Trackbacks/Pingbacks

  1. test « Blog de teste

RSS feed for comments on this post

Leave a Reply

 

  • Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you find the information useful. If you spot something that's incorrect or confusing, please write a comment and let me know. Drop me a line if there's something you want to know more about and I'll do my best to write a post on the topic.
    -- Major Hayden

    Flattr this