diff --git a/src/classes/api/endpoints/class-tainacan-rest-items-controller.php b/src/classes/api/endpoints/class-tainacan-rest-items-controller.php index b4c73a3bc..9bdf84c9f 100644 --- a/src/classes/api/endpoints/class-tainacan-rest-items-controller.php +++ b/src/classes/api/endpoints/class-tainacan-rest-items-controller.php @@ -404,7 +404,7 @@ class REST_Items_Controller extends REST_Controller { $args['post_parent'] = $item_id; $args['post_type'] = 'attachment'; $args['post_status'] = 'any'; - + $args['orderby'] .= ' title ID'; unset($args['perm']); $posts_query = new \WP_Query(); @@ -429,6 +429,7 @@ class REST_Items_Controller extends REST_Controller { 'date' => $post->post_date, 'date_gmt' => $post->post_date_gmt, 'author' => $post->post_author, + 'menu_order' => $post->menu_order, 'url' => wp_get_attachment_url( $post->ID ), 'media_type' => wp_attachment_is_image( $post->ID ) ? 'image' : 'file', 'alt_text' => get_post_meta( $post->ID, '_wp_attachment_image_alt', true ), diff --git a/src/classes/entities/class-tainacan-item.php b/src/classes/entities/class-tainacan-item.php index a8fb33fdb..e911d1671 100644 --- a/src/classes/entities/class-tainacan-item.php +++ b/src/classes/entities/class-tainacan-item.php @@ -84,7 +84,7 @@ class Item extends Entity { function get_attachments($exclude = null){ $item_id = $this->get_id(); - if(!$exclude){ + if (!$exclude) { $to_exclude = [get_post_thumbnail_id( $item_id )]; if ($this->get_document_type() == 'attachment') { $to_exclude[] = $this->get_document(); @@ -94,7 +94,7 @@ class Item extends Entity { } $attachments_query = [ - 'orderby' => 'menu_order', + 'orderby' => 'menu_order title ID', 'order' => 'ASC', 'post_type' => 'attachment', 'posts_per_page' => -1, diff --git a/src/views/admin/js/wp-media-frames.js b/src/views/admin/js/wp-media-frames.js index f9dc2e405..99484951b 100644 --- a/src/views/admin/js/wp-media-frames.js +++ b/src/views/admin/js/wp-media-frames.js @@ -30,7 +30,7 @@ export default { }), autoSelect: true, sortable: true, - filterable: 'unattached', + filterable: false, }) ] }).open();