Custom column, order by option
-
I am working with the events manager plugin on a site. I have managed to add an extra column to the posts admin page which displays the event start date.
What i’d like to be able to do is order the posts by the event start date, in the same way you can order by date and title. Is this possible?
Cheers
Heres the code ive added to my functions file:
function my_columns($columns) { $columns['event'] = 'Event Date'; return $columns; } function my_show_columns($name) { global $post; switch ($name) { case 'event': $event = get_post_meta($post->ID, '_EventStartDate', true); echo $event; } } add_filter('manage_posts_columns', 'my_columns'); // post columns add_action('manage_posts_custom_column', 'my_show_columns'); // Add custom column
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Custom column, order by option’ is closed to new replies.