Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
487 views
in Plugins by

Say I want to link to the tags page in my plugin, what is the best way to do this? For my own site I can make a url something like this:

$url = qa_path_to_root() . 'tags';

That would make a URL like example.com/tags. However, for users on different tag structures it should be example.com/?qa=tags. Is there a generic way to make URLs for Q2A?

Q2A version: 1.5.2

1 Answer

0 votes
by
selected by
 
Best answer

Oops, didn't look closely enough at the docs. I've just seen there is a function qa_path(). Looks like the $request parameter takes what would be the request using the 'best' URL structure.

For example qa_path('tags') or qa_path('tag/test').

...