• Dear,

    My apache2 server error logs receive sometimes 10 lines a minute with the following php7 warning content:
    <...> HP Warning: sprintf(): Too few arguments in <MY_ROOT>/wp-content/themes/alyssas-blog/ripplethemes/template-tags.php on line 30

    While this is just a warning, this is using a lot of logs space and attention.

    Would it be possible to replace the following code in template-tags.php :

    
    		$posted_on = sprintf(
    			/* translators: %s: post date. */
    			'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
    		);
    

    by either this:

    
    		$posted_on =
    			'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>';
    

    or this:

    
    		$posted_on = sprintf(
    			'%s',
    			'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
    		);
    

    or this:

    
    		$posted_on = sprintf(
    			/* translators: %s: post date. */
    			esc_html_x('%s', 'post author', 'alyssas-blog'),
    			'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
    		);
    

    or any other solution please?

    If this is not possible or not a good idea, sorry for the inconvenience.

    Best regards.

    The page I need help with: [log in to see the link]

  • The topic ‘php7 warning: sprintf Too few arguments in template-tags.php on line 30’ is closed to new replies.