• Resolved welcomebrand

    (@welcomebrand)


    Hi,

    I am getting an error on the featured images panel when trying to add a new image.

    Warning: sprintf() [function.sprintf]: Too few arguments in W:\xampp\htdocs\Shades Of China\www\wp-admin\includes\post.php on line 1148

    This is a brand new db with just the wp install run, a brand new install of wp (downloaded just now) and no active plugins. All settings are default, nothing has been changed.

    I’ve seen a few people report this issue but I’ve not seen anything that solves the problem so I’m hoping someone has fixed this!

    Any thoughts on how I might fix this? I don’t have this issue on any of my existing sites but I assume it’s not going to be a core issue either.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    This might seem a bit random, but does the filename of the image contain a % (percent) symbol?

    Thread Starter welcomebrand

    (@welcomebrand)

    Hi Ross,

    Thanks for looking at the q, no there’s no image. I can’t get as far as uploading anything. The featured img panel in the posting screen simply has that error by default.

    If I upload an img through the normal media picker and set it as a featured image, I get this:

    Warning: sprintf() [function.sprintf]: Too few arguments in W:\xampp\htdocs\Shades Of China\www\wp-admin\includes\post.php on line 1159

    Ah, I see.

    I think it’s because your directory path contains spaces (in “Shades Of China”). These spaces get URL encoded to %20, and the extra % symbols seem to confuse the PHP sprintf function, which explains the warning you’re seeing.

    I think this might be considered a bug. I’ll take a look at the core Trac and see if anything’s been reported there.

    A workaround would be install WordPress somewhere with no spaces in the directory path (change “Shades Of China” to “ShadesOfChina”, for example).

    Ross.

    Thread Starter welcomebrand

    (@welcomebrand)

    Thanks again Ross, much appreciated.

    Installed in /ShadesOfChina/ without spaces in the directory name and it’s working ??

    Problem solved!

    J.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Featured images error’ is closed to new replies.