1

I want to know if exists function that detect if some database query run from widget, for example from recent_posts widget or search_widget.

1
  • No, there is not such thing. – cybmeta Jan 13 '15 at 9:48
1

You could use the is_main_query Function :

http://codex.wordpress.org/Function_Reference/is_main_query

Happy Coding, Kuchenundkakao

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.