0

This is in the twentyeleven theme. Can somebody tell me what this is?

<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' )
             ^^^^                   ^^^^

My best googling tells me it's something to do with i18n, but I don't think that's the full story because some of them spit out things like author names and post titles, like this example:

<a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a>
                          ^^^^         ^^^^               ^^^^

At any rate, is this something I can/should be using? What's it actually called, and where is it documented?

Sorry if this is a dumb question, but it's a hard thing to google! Thanks!

1 Answer 1

0

See the php sprintf and printf functions. They are tokens that get data from a function or variable separated by commas at the end of the call.

$variable = 'sprintf';
printf( 'Hey dude check out the %s php function', $variable );
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.