[wp-trac] [WordPress Trac] #29629: Shortcode playlist random order parameter can't work

WordPress Trac noreply at wordpress.org
Thu Sep 11 19:56:01 UTC 2014


#29629: Shortcode playlist random order parameter can't work
--------------------------+-----------------------------
 Reporter:  ialocin       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Shortcodes    |    Version:  4.0
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The parameter `RAND` for the argument `order` gets replaced with `none`
 {{{
 1246            if ( 'RAND' == $atts['order'] ) {
 1247                    $atts['orderby'] = 'none';
 1248            }
 }}}
 see: [https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/media.php#L1246]

 Which gets passed to `get_posts()` and won't give back a random order

 `RAND` should be replaced by `rand` - like this:

 {{{
 1246            if ( 'RAND' == $atts['order'] ) {
 1247                    $atts['orderby'] = 'rand';
 1248            }
 }}}

 than it works perfectly fine.

 Discovered while answering a question at WPSE
 http://wordpress.stackexchange.com/q/161084/22534

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29629>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list