Skip to content

Commit

Permalink
Merge branch 'fix/12795-1' of \apache\htdocs\wordpress\wp-content\plu…
Browse files Browse the repository at this point in the history
…gins\gutenberg-source into fix/12795-2
  • Loading branch information
bobbingwide committed Jul 2, 2020
2 parents 4554c49 + 367c02c commit b75e1aa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,14 +480,14 @@ function gutenberg_render_block_with_assigned_block_context( $pre_render, $parse
*
* @see https://core.trac.wordpress.org/ticket/46294
*
* @param string $orderby Current orderby value.
* @param string $orderby Current orderby value.
* @param WP_Query $query Query object.
*/
function gutenberg_posts_orderby( $orderby, $query ) {
global $wpdb;
if ( defined('REST_REQUEST') && REST_REQUEST ) {
if ( $query->query['orderby'] === 'menu_order' ) {
$orderby = "$wpdb->posts.menu_order,post_title,id asc";
if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
if ( 'menu_order' === $query->query['orderby'] ) {
$orderby = "$wpdb->posts.menu_order,$wpdb->posts.post_title,$wpdb->posts.id " . $query->query['order'] ;
}
}
return $orderby;
Expand Down

0 comments on commit b75e1aa

Please sign in to comment.