• Hello,
    I’m working on my webpage and I after add a post I saw a problem under the title of post:

    Warning: sprintf(): Too few arguments in C:\xampp\htdocs\wordpress\wp-content\themes\jobeleon\inc\template-tags.php on line 132

    I checked that file and I fount it:

    printf(__('Posted on <a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a><span> by <span class="author vcard"><a href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'jobeleon'), esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'jobeleon'), get_the_author())), get_the_author()

    Someone could check it how can I fix it?

    Greet, kibus90.

    • This topic was modified 7 years, 1 month ago by kibus90.
    • This topic was modified 7 years, 1 month ago by kibus90.
    • This topic was modified 7 years, 1 month ago by kibus90.
Viewing 1 replies (of 1 total)
  • Whatever it is, it is a problem with code within your there “jobeleon”. Suggest that you seek support with the theme author or vendor.
    The code looks ok to me, however it uses an unusual positional argument syntax (e.g. %4s) which is involved in a recent sql injection security bug, it could be that the changed checking for this is tripping you up, combined with the call to sprintf on one of the arguments.
    If you want to tinker with the code then I would suggest that you remove this nested sprintf call like this:

    $newvar = sprintf(__('View all posts by %s', 'jobeleon'), get_the_author());
    printf( ..........

    Then put esc_attr($newvar) in the argument list.

Viewing 1 replies (of 1 total)
  • The topic ‘Warning: sprintf(): – How can I fix it?’ is closed to new replies.