Last active
January 28, 2018 06:37
-
-
Save trueqap/55c709a313c8ff8008433e06f28f7d62 to your computer and use it in GitHub Desktop.
Add time and date to WooCommerce order page with new column.
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 | |
//https://woopress.hu/forumok/tema/rende/ | |
function RENDELES_DATUMA_ES_IDO_OSZLOP( $columns ) { | |
$new_columns = ( is_array( $columns ) ) ? $columns : array(); | |
unset( $new_columns[ 'order_actions' ] ); | |
$new_columns['RENDELES_DATUMA_ES_IDO'] = 'Rendelés dátuma'; | |
$new_columns[ 'order_actions' ] = $columns[ 'order_actions' ]; | |
return $new_columns; | |
} | |
function RENDELES_DATUMA_ES_IDO_TARTALOM( $column ) { | |
global $post; | |
$data = get_post_meta( $post->ID ); | |
if ( $column == 'RENDELES_DATUMA_ES_IDO' ) { | |
$order = new WC_Order($post->ID); | |
$order_date = $order->order_date; | |
echo $order_date ; | |
} | |
} | |
add_filter( 'manage_edit-shop_order_columns', 'RENDELES_DATUMA_ES_IDO_OSZLOP' ); | |
add_action( 'manage_shop_order_posts_custom_column', 'RENDELES_DATUMA_ES_IDO_TARTALOM', 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment