Created
December 11, 2018 09:57
-
-
Save rwkyyy/e022149949206faa2265acb01b69e604 to your computer and use it in GitHub Desktop.
change query of comments in wordpress (globally)
This file contains hidden or 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
function rwk_change_query( $comments ) { | |
$comments->query_vars['order'] = 'DESC'; | |
$comments->meta_query->parse_query_vars( $comments->query_vars ); | |
} | |
add_action( 'pre_get_comments', 'rwk_change_query' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment