Skip to content

Commit

Permalink
Merge pull request #2350 from jamesgol/orderbyfield
Browse files Browse the repository at this point in the history
Allow fields to be sorted by orderby & fix #2277
  • Loading branch information
Shelob9 committed Sep 23, 2014
2 parents 2589349 + 52d18db commit 5611248
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions classes/Pods.php
Original file line number Diff line number Diff line change
Expand Up @@ -1343,11 +1343,9 @@ public function field ( $name, $single = null, $raw = false ) {
unset( $item_data );

// Return all of the data in the order expected
if ( empty( $params->orderby ) ) {
foreach ( $ids as $id ) {
if ( isset( $items[ $id ] ) )
$data[ $id ] = $items[ $id ];
}
foreach ( $items as $id => $v ) {
if ( in_array( $id, $ids ) )
$data[ $id ] = $v;
}
}
}
Expand Down

0 comments on commit 5611248

Please sign in to comment.