I have an WP_Query array made up from two WP_Query() objects merged together as follows:
$query1 = new WP_Query($args1); $query2 = new WP_Query($args2); $wp_query = new WP_Query(); $wp_query->posts = array_merge( $query1->posts, $query2->posts );
Each of the original queries are ordered by name - 'orderby' => 'post_name' - but array merge doesn't obviously respect that.
Does anyone know a way to sort $wp_query arrays after they have been populated? Or do I have to fathom and write a custom php sorting function of my own?