Don’t Be Shy to Use sprintf with WordPress
Don’t be shy to use the printf
and sprintf
functions with WordPress. It makes code much easier to read. Take a look at the following examples.
echo '<a href="' . get_permalink() . '" class="link">' . get_the_title() . '</a>';