0

I'm looking at some plugin code that looks like so:

get_previous_posts_link(__('<span>&larr;</span> Newer', 'gc-sermons'), $total_pages

When I look at the WP function reference for get_previous_post_link I see that it is defined with only one parameter like so:

get_previous_posts_link( string $label = null )

The first argument passed makes sense with above parameter:

__('<span>&larr;</span> Newer', 'gc-sermons')

But what is the second argument ($total_pages) for? Is there any reason to retain it?

0

There's no reason for it to be there, and it won't do anything. Only the author would know why it's there, but it's likely a mistake.

| improve this answer | |
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review – Mayeenul Islam Jan 22 at 4:58
  • 1
    The question was "But what is the second argument ($total_pages) for? Is there any reason to retain it?" I've answered it. – Jacob Peattie Jan 22 at 5:07
  • Thanks for the clarification :) – Mayeenul Islam Jan 22 at 5:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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