I'm trying to sort the posts (in the edit screen (wp-admin/edit.php)) by meta value corresponding to an event date but I can't get it to work properly...
For example, ASC returns:
2012/10/12
2012/12/11
2012/09/7
and DESC returns:
2012/09/7
2012/12/11
2012/10/12
I'm using the following functions to create the sortable custom columns:
function event_date_column_display( $name ) { global $post; switch ($name) { case 'event-date': $pid = $post->ID; $event_date = get_post_meta($pid, '_event_date', TRUE); if ($event_date) { echo $event_date; } } } function event_date_column_register_sortable( $columns ) { $columns['event-date'] = 'event-date'; return $columns; } Any hint on how to fix this?