1

I am tring to access the author's id using

get_query_var('author')

, but this only seems to work on the page, not within plguin code.

How do I access this from within plugin code?

1 Answer 1

2

get_query_var works within any code, theme or plugin. But it will only return meaningful data after the query has been processed. So, use it on the init hook or later.

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.