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_Querycalls 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().
Hello,
It seems that the
eventorganiser_admin_calendar()
function (which handles theevent-admin-cal
Ajax action) always performs the same database query twice.In fact, the constructor for
WP_Query
calls thequery()
method, which itself already calls theget_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