In trying to figure out a WordPress 2.7 Press This error I was getting when selecting text prior to using the 2.7 bookmarklet, I kept getting an error. A little web surfing via Google found this helpful forum post…

When trying to use the pressthis tool I get the error:

Fatal error: Call to undefined function: htmlspecialchars_decode in /home/content/r/o/b/robertbasil/html/wp-admin/press-this.php on line 554

Line 554:

I’m using php4, I thought this was a php5 error?

The original poster then provided this bug-fix tip to resolve the problem…

I figured out a quick fix.

Since htmlspecialchars_decode only works with php 5.10 and above I just removed that part of the code.

In the press-this.php file on line 554 change this:

<?php if ($selection) echo wp_richedit_pre(htmlspecialchars_decode($selection)); ?>

To this:

<?php if ($selection) echo wp_richedit_pre($selection); ?>

Now it works just fine.

The code really should do a check to see if php 5.1 is installed before calling the htmlspecialchars_decode function.

I tested it and it seems to be working for me now.

via WordPress › Support » pressthis error with 2.7.

Tags: , ,

Leave a Reply

You must be logged in to post a comment.