Hello, is there any updates on the query sorting issue, it is still present? We are currently using a hacky usort workaround so we could launch the site. Here is some additional information if it helps:
How to replicate
1. Install WP
2. Use the default Twenty Twenty-Two, Twenty Twenty-Three, or Twenty Twenty-Four theme.
3. Add Posts for testing
4. Add Lazy block
5. Add Lazy block template to theme folder /twentytwentyfour/blocks/lazyblock-test/block.php
6. Query posts with get_posts() or WP_Query()
I have verified that there is not any hooks like pre_get_posts, and all queries are properly reset in Twenty Twenty-Two, Twenty Twenty-Three, or Twenty Twenty-Four themes that could be causing issues.
Here is some additional queries that are being ignored.
$args = array(
'numberposts' => -1,
'orderby' => 'title',
'order' => 'ASC',
);
$custom_posts = get_posts($args);
var_dump($custom_posts);
$args = array(
'numberposts' => -1,
'orderby' => 'title',
'order' => 'DESC',
);
$custom_posts = get_posts($args);
var_dump($custom_posts);
$args = array(
'numberposts' => -1,
'orderby' => 'ID',
'order' => 'ASC',
);
$custom_posts = get_posts($args);
var_dump($custom_posts);
$args = array(
'numberposts' => -1,
'orderby' => 'author',
'order' => 'ASC',
);
$custom_posts = get_posts($args);
var_dump($custom_posts);
$args = array(
'numberposts' => -1,
'orderby' => 'type',
'order' => 'ASC',
);
$custom_posts = get_posts($args);
var_dump($custom_posts);
$args = array(
'numberposts' => -1,
'orderby' => 'parent',
'order' => 'ASC',
);
$custom_posts = get_posts($args);
var_dump($custom_posts);
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'orderby' => 'title',
'order' => 'ASC',
);
$custom_posts = new WP_Query($args);
var_dump($custom_posts);
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'ASC',
);
$custom_posts = new WP_Query($args);
var_dump($custom_posts);
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'orderby' => 'name',
'order' => 'ASC',
);
$custom_posts = new WP_Query($args);
var_dump($custom_posts);
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'orderby' => 'modified',
'order' => 'ASC',
);
$custom_posts = new WP_Query($args);
var_dump($custom_posts);
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'orderby' => 'menu_order',
'order' => 'ASC',
);
$custom_posts = new WP_Query($args);
var_dump($custom_posts);
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'orderby' => 'rand',
);
$custom_posts = new WP_Query($args);
var_dump($custom_posts);