How to display post Expending plugin on posts data table wordpress plugin
I am working on WordPress using the WordPress plugin post data table and im using Post Exping plugin I want to display expiration data in the WordPress data table.
$post_data_trans = array(
'{id}' => $_post->ID,
'{title}' => $title,
'{category}' => get_the_category_list( ', ', '', $_post->ID ),
'{date}' => get_the_date( $date_format, $_post ),
'{expiring}' => get_the_date( $date_format, $post_id, 'expire_date' ),
'{author}' => $author,
'{content}' => $this->get_post_content( $args['content_length'] )
);
this code is for data table wordpress plugin I am using expiring column from Post Exping plugin and this is the code for expiration
if( $column_name === 'expiring' ){
$postexpired = get_post_meta( $post->ID, 'postexpired', true );
if( preg_match("/^\d{4}-\d{2}-\d{2}$/", $postexpired) ) {
$postexpired .= ' 00:00';
}
echo !empty($postexpired) ? $postexpired : __('Never');
}
and I am only getting the date for the post, not the expiring date, please anyone can help me.
+3
source to share
No one has answered this question yet
Check out similar questions: