WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Featured images error (5 posts)

  1. welcomebrand
    Member
    Posted 2 years ago #

    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!

  2. Ross Hanney
    Member
    Posted 2 years ago #

    Hello,

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

  3. welcomebrand
    Member
    Posted 2 years ago #

    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

  4. Ross Hanney
    Member
    Posted 2 years ago #

    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.

  5. welcomebrand
    Member
    Posted 2 years ago #

    Thanks again Ross, much appreciated.

    Installed in /ShadesOfChina/ without spaces in the directory name and it's working :)

    Problem solved!

    J.

Topic Closed

This topic has been closed to new replies.

About this Topic