How to display user order by role

i dont know how to achieve this in query arg. This is because it cannot be done using just arguments. No option for role is listed in the order/orderby parameter docs. There is no option to sort by user role in WordPress. Instead, you’re going to have to query for all gold role users, grab … Read more

Replace/Mute/Stop Search Query

I had a quick grep for SQL_CALC_FOUND_ROWS and found a few instances. I’m not sure which one is being called in your case, but here’s an interesting one from wp-includes/class-wp-query.php line 2904 onwards: $found_rows=””; if ( ! $q[‘no_found_rows’] && ! empty( $limits ) ) { $found_rows=”SQL_CALC_FOUND_ROWS”; } $old_request = “SELECT $found_rows $distinct $fields FROM {$wpdb->posts} … Read more

How is it possible to get top comment from all children?

You could adapt get_post_acestors(), and write a similar function for comments. Here is an example that returns the top comment’s id or false. Not tested! function get_root_comment( $comment_id ) { $comment = get_comment( $comment_id ); if ( ! $comment || empty( $comment->comment_parent ) || $comment->comment_parent == $comment_id ) { return false; } $ancestors = []; … Read more