Title: Overwrite Query.php function
Last modified: January 31, 2017

---

# Overwrite Query.php function

 *  Resolved [sproutchris](https://wordpress.org/support/users/sproutchris/)
 * (@sproutchris)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/overwrite-query-php-function/)
 * So I’m working on a client website and there was a hard code solution made to
   the /wp-content/plugins/the-events-calendar/src/Tribe/Query.php file to the function
   getHideFromUpcomingEvents(). Obviously, I have re-add this custom code every 
   time I update the plugin. Is there a better way to tackle this issue?

Viewing 1 replies (of 1 total)

 *  [Caroline](https://wordpress.org/support/users/tribecari/)
 * (@tribecari)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/overwrite-query-php-function/#post-8731669)
 * Hi [@sproutchris](https://wordpress.org/support/users/sproutchris/),
 * Thanks for taking the time to reach out! You can make changes to plugin functions
   without resorting to hard-coded solutions by using filters or hooks to modify
   your queries. Simply adapt the code from your **Query.php** file to a separate
   function in a custom plugin or theme file, then replace that in the template 
   files. Our [Themer’s Guide](https://theeventscalendar.com/knowledgebase/themers-guide/)
   provides some more information on how modifications work with our plugins and
   may be useful to you as you’re making these changes!
 * I hope that helps to get you started! Thanks again for reaching out, and let 
   us know if you should have any other questions!

Viewing 1 replies (of 1 total)

The topic ‘Overwrite Query.php function’ is closed to new replies.

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Caroline](https://wordpress.org/support/users/tribecari/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/overwrite-query-php-function/#post-8731669)
 * Status: resolved