wp-better-attachments icon indicating copy to clipboard operation
wp-better-attachments copied to clipboard

Initial Upload Order

Open ghost opened this issue 9 years ago • 2 comments

I'm trying to figure out how the plugin orders the attachments initially in the back end after they have been uploaded.

Ideally I would like to have them mirror the order in which they were uploaded in and then if need be I can manually drag and drop, but I generally uploaded them with file names ordered alphabetically and it seems the order they appear is random on the back end page.

Any tips? Thanks!

ghost avatar Feb 27 '16 02:02 ghost

Greetings,

It is set to order by menu order ascending so I believe it is in the exact opposite order of how you wanted it. If you want to alter the query you can use the pre_get_posts filter and just filter the query. The 3 important arguments you would be interested in would be order => ASC, order_by => menu_order, post_type => attachment. That would be a match for the query to filter. I hope this helps.

Thanks, Dan

DHolloran avatar Feb 28 '16 23:02 DHolloran

Thanks Dan,

I do not mean as the attachments are outputted, I am referring to how they appear in the back end in the dashboard, the initial order in which the appear after they uploaded before they are dragged and dropped. That order seems random.

Thanks for the response!

Kyle

On Feb 28, 2016, at 3:13 PM, Danny Holloran [email protected] wrote:

Greetings,

It is set to order by menu order ascending so I believe it is in the exact opposite order of how you wanted it. If you want to alter the query you can use the pre_get_posts filter and just filter the query. The 3 important arguments you would be interested in would be order => ASC, order_by => menu_order, post_type => attachment. That would be a match for the query to filter. I hope this helps.

Thanks, Dan

— Reply to this email directly or view it on GitHub https://github.com/DHolloran/wp-better-attachments/issues/76#issuecomment-189966282.

ghost avatar Feb 29 '16 00:02 ghost