Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin calendar: Avoid duplicate database query #522

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

zosterops-lateralis
Copy link

Hello,

It seems that the eventorganiser_admin_calendar() function (which handles the event-admin-cal Ajax action) always performs the same database query twice.

In fact, the constructor for WP_Query calls the query() method, which itself already calls the get_posts() method. Therefore, calling $query->get_posts() after contructing the $query object is unnecessary, as all the posts are already available in the $query object, and it will needlessly repeat the previous database query.

This PR simply proposes to remove the call to $query->get_posts().

Thanks!

Zosterops

The constructor for `WP_Query` already calls its `get_posts()` method.
There is no need to call it again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant