[wp-trac] [WordPress Trac] #24445: Twenty Thirteen: twentythirteen_body_class function make the load more slower!
WordPress Trac
noreply at wordpress.org
Tue May 28 21:12:14 UTC 2013
#24445: Twenty Thirteen: twentythirteen_body_class function make the load more
slower!
---------------------------+------------------------------
Reporter: alexvorn2 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version:
Severity: normal | Resolution:
Keywords: |
---------------------------+------------------------------
Comment (by nacin):
Care to tell us how long the query in is_multi_author() is taking? How
many rows in your posts table?
This function is not new. It was used similarly in Twenty Eleven and
Twenty Twelve as well.
I was thinking about an optimization the other day to is_multi_author(),
but it would only help for multi-author blogs. Basically:
{{{
$is_multi_author = ( count( array_unique( wp_list_pluck( 'post_author',
$wp_query->posts ) ) ) > 1 );
}}}
If that returns false, we'd have to do the query either way. That said, I
find it hard to believe that query is taking a particularly long time.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24445#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list