Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Edit admin columns
- function my_page_columns($columns) {
- $columns = array(
- 'cb' => '<input type="checkbox" />',
- 'title' => 'Title',
- 'publish' => 'Publish date',
- 'expire' => 'Expire date',
- 'date' => 'Date',
- );
- return $columns;
- }
- function my_custom_columns($column) {
- global $post;
- if($column == 'publish') {
- if(get_field('publish_date')) {
- echo get_field('publish_date');
- }
- } elseif($column == 'expire') {
- if(get_field('expire_date')) {
- echo get_field('expire_date');
- }
- }
- }
- function my_column_register_sortable( $columns )
- {
- $columns['publish'] = 'publish';
- $columns['expire'] = 'expire';
- return $columns;
- }
- add_filter('manage_edit-webinar_sortable_columns', __NAMESPACE__ . '\\my_column_register_sortable' );
- add_action('manage_webinar_posts_custom_column', __NAMESPACE__ . '\\my_custom_columns');
- add_filter('manage_webinar_posts_columns', __NAMESPACE__ . '\\my_page_columns');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement