Back to contents

JetEngine. How to display date in an admin column

This tutorial describes the process of displaying the date in the admin column in the custom post type in the WordPress Dashboard.

We are going to provide a step-by-step guide on how to show the date of a custom post in an admin column in the WP Dashboard in a well-organized way with JetEngine plugin based on the example of the Team custom post type. You can create an additional admin column with the data from the meta field for any custom post type created with JetEngine.

Displaying date in an admin column

1 Step – Go to the JetEngine > Post Types section in the WP Dashboard and in the Team custom post type add a date meta field.

start_from-meta-field

2 Step – Then, if you scroll down the page there is the Admin Columns block. Here you need to click the Add Column option and fill the fields with appropriate data.
In the Type field, we choose the Custom Callback option from the drop-down list and in the Callback field click the Select from existing callbacks line. In the appeared window you need to choose the first callback, jet_engine_custom_cb_date.

select-the-callback

Then, you should set the meta field, which to get the date from and the format.

set-callback

Also, if you want to make the admin column sortable, move the toggle next to the Is Sortable field.

NOTE!
It is necessary to enable the Is Numeric Field option that the data will be sorted correctly. Don’t forget to update the post type and save the changes.

3 Step – After that, in the Team custom post type in the WP Dashboard edit a certain event and specify the date, from which he or she started to work in the company, right here.

edit-the-custom-meta-field

4 Step – Now you can see the date in an admin column.

date-admin-column

Well done! Now you know how to display a date in the admin column for the custom post type using JetEngine functionality.