[wp-trac] Re: [WordPress Trac] #6476: 2.5 Gallery shortcode orderby not working

WordPress Trac wp-trac at lists.automattic.com
Tue Apr 1 05:19:59 GMT 2008


#6476: 2.5 Gallery shortcode orderby not working
---------------------------+------------------------------------------------
 Reporter:  GeoffHarrison  |        Owner:  anonymous
     Type:  defect         |       Status:  reopened 
 Priority:  normal         |    Milestone:  2.5.1    
Component:  General        |      Version:  2.5      
 Severity:  normal         |   Resolution:           
 Keywords:  has-patch      |  
---------------------------+------------------------------------------------
Comment (by andy):

 Don't remove it. Make it safe. Wrap it:
 {{{
 if ( isset($attr['orderby']) ) {
         preg_match('/(^([a-z0-9_]+( +(ASC|DESC))?(, +?|$))+|RAND\(\))/i',
 $attr['orderby'], $obmatches);
         if ( !$obmatches[0] )
                 unset($attr['orderby']);
 }
 }}}

 Tested with gallery shortcodes with and without orderby, all good now.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6476#comment:13>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list