In a plugin, I am generating a paginated link to a category,
i.e. http://localhost/?cat=17&paged=5
. The category is known by slug and id.
Is there a way to have this URL converted to the user defined "nice permalink" format,
i.e. http://localhost/category/foo/page/5
?
(Assuming we're running Wordpress 2.8/2.9+)
Edit: Since there are some misunderstandings about what I'm trying to achieve, here's what I have:
- The category ID
- The page number (i.e. the fifth page of that category's archive)
With these data I can create the URL to that page, which would be, for example, http://localhost/?cat=17&paged=5
, and that works well. The problem is of a visual nature: If the user has pretty permalinks enabled, then this won't fit in very well.
Question is: How do I get the correct, pretty permalink (i.e. http://localhost/category/foo/page/5
) from (or for) the information I have?
Edit 2: Obviously if a user has pretty permalinks disabled, then there are no pretty permalinks. I know that, and that is really not subject of the question ... For the moment, let's just assume the user has an arbitrary permalink setting. I generate a link, and it should look like the user wants it to.