Allow 'id' to work in get_bookmarks(). Add link_notes even though such sorting is a bad idea. see #18068 for 3.3.

git-svn-id: http://svn.automattic.com/wordpress/trunk@18840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2011-09-30 17:03:46 +00:00
parent 33113c01c7
commit acbc9144dd
1 changed files with 4 additions and 1 deletions

View File

@ -227,8 +227,11 @@ function get_bookmarks($args = '') {
$orderparams = array();
foreach ( explode(',', $orderby) as $ordparam ) {
$ordparam = trim($ordparam);
if ( in_array( $ordparam, array( 'id', 'name', 'url', 'visible', 'rating', 'owner', 'updated' ) ) )
$keys = array( 'link_id', 'link_name', 'link_url', 'link_visible', 'link_rating', 'link_owner', 'link_updated', 'link_notes' );
if ( in_array( 'link_' . $ordparam, $keys ) )
$orderparams[] = 'link_' . $ordparam;
elseif ( in_array( $ordparam, $keys ) )
$orderparams[] = $ordparam;
}
$orderby = implode(',', $orderparams);
}