Created
December 31, 2014 20:43
-
-
Save tylerdigital/c127ae0c33f456b1f6c6 to your computer and use it in GitHub Desktop.
Fix WordPress Hierarchical Post Performance Issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'pre_get_posts', array( $this, 'fix_hierarchy_performance_issue' ) ); | |
function fix_hierarchy_performance_issue( $query ) { | |
if ( $query->query['post_type']=='hotspot' && $query->query['orderby']=='menu_order title' ) { | |
$query->set( 'orderby', 'menu_order title post_name' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment