Forked from barryhughes/add-post-date-column-to-events-wp-list-table.php
Last active
May 9, 2018 16:45
-
-
Save cliffordp/68727f3b3d1d3028fe3977a02852e5cb to your computer and use it in GitHub Desktop.
Add post date column to the events WP List Table (TEC 4.x)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The Events Calendar: Add "Post Date" column to the wp-admin Events posts list. | |
* | |
* @link https://gist.github.com/barryhughes/38d7131462bd3912e571d5e6f3b5762e | |
*/ | |
add_action( 'manage_posts_custom_column', 'events_post_date_column', 10, 2 ); | |
add_filter( 'manage_tribe_events_posts_columns', 'events_post_date_column_header' ); | |
function events_post_date_column( $column_id, $post_id ) { | |
echo 'post_date' === $column_id ? get_the_date( '', $post_id ) : ''; | |
} | |
function events_post_date_column_header( $headers ) { | |
$headers['post_date'] = 'Post Date'; | |
return $headers; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment