You can add any custom field in your admin post type / page / custom post type list using below code.
Below code example for display event start date in event post type admin list.
here in below example “event” is custom post type and “event_date_start” is custom field.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
add_filter('manage_event_posts_columns', 'hs_event_table_head'); function hs_event_table_head( $columns ) { $columns['event_date_start'] = '<sapn>Start Date</sapn>'; return $columns; } add_action( 'manage_event_posts_custom_column', 'hs_event_table_content', 10, 2 ); function hs_event_table_content( $column_name, $post_id ) { if( $column_name == 'event_date_start' ) { $featured_product = get_post_meta( $post_id, 'event_date_start', true ); echo $featured_product; } } |