WordPress.org

Make WordPress Core

Changeset 22891


Ignore:
Timestamp:
11/28/2012 03:51:27 AM (7 years ago)
Author:
nacin
Message:

In the gallery shortcode, handle mapping of "ids" to include and orderby before the post_gallery filter. see #21816. fixes #22617.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r22889 r22891  
    670670    $instance++;
    671671
     672    if ( ! empty( $attr['ids'] ) ) {
     673        // 'ids' is explicitly ordered
     674        $attr['orderby'] = 'post__in';
     675        $attr['include'] = $attr['ids'];
     676    }
     677
    672678    // Allow plugins/themes to override the default gallery template.
    673679    $output = apply_filters('post_gallery', '', $attr);
     
    691697        'columns'    => 3,
    692698        'size'       => 'thumbnail',
    693         'ids'        => '',
    694699        'include'    => '',
    695700        'exclude'    => ''
     
    699704    if ( 'RAND' == $order )
    700705        $orderby = 'none';
    701 
    702     if ( !empty( $ids ) ) {
    703         // 'ids' is explicitly ordered
    704         $orderby = 'post__in';
    705         $include = $ids;
    706     }
    707706
    708707    if ( !empty($include) ) {
Note: See TracChangeset for help on using the changeset viewer.