WordPress.org

Ready to get started?Download WordPress

Forums

Why is the order of uploads in the media manager reversed? (1 post)

  1. chrishajer
    Member
    Posted 4 years ago #

    Using 2.8.4

    Everything with the built-in media manager works just fine. But there is one thing left that I can't explain. When I upload multiple files at one time, they are initially sorted or at least displayed that they are uploaded in alphabetical order. After I press [save all changes] the order gets reversed, like it's reverse alphabetical order. I can quickly explicitly set an order by typing a number into each field, the clicking [save all changes] again, and the new explicit order is saved. But I am wondering what it is that reverses the order when it's first being displayed, and if I could specify somewhere that the attachments are used in alphabetical order, rather than menu order.

    I made a video of what happens when I upload multiple files. The file names are the same except for the image number at the end -- (1) for example.

    http://www.chrishajer.com/wordpress/media/index.htm

    Here's the code I am using to pull out the attachments for use in a template:

    $att_array = array(
    		'post_parent' => $post->ID,
    		'post_type' => 'attachment',
    		'post_mime_type' => 'image',
    		'order' => 'ASC',
    		'order_by' => 'menu_order ID'
    );
    
    $attachments = get_children($att_array);

    Maybe I can just change the order_by to the slug or something, which would do essentially the same thing as setting the explicit order (which is based on the slug or filename anyway)?

    I searched the forums and found this identical, unresolved problem:
    http://wordpress.org/support/topic/280734?replies=2

    Thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic