Created
February 21, 2019 13:36
-
-
Save Musilda/3306d999b7eb2efb6feaf3daac06b6b7 to your computer and use it in GitHub Desktop.
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 | |
add_filter( 'manage_edit-shop_order_columns', 'barcode_column', 99999 ); | |
add_filter( 'manage_edit-page_columns', 'barcode_column', 99999 ); | |
function barcode_column($columns) { | |
$new_columns = array(); | |
foreach($columns as $key => $item){ | |
$new_columns[$key] = $item; | |
if($key == 'cb'){ | |
$new_columns['zasilkovna'] = __( 'Barcode', 'skoleni' ); | |
} | |
} | |
$new_columns['zasilkovna_send'] = __( 'Zásilkovna', 'skoleni' ); | |
return $new_columns; | |
} | |
add_action( 'manage_shop_order_posts_custom_column', 'barcode_column_display', 10, 2 ); | |
add_action( 'manage_page_posts_custom_column', 'barcode_column_display', 10, 2 ); | |
function barcode_column_display($column_name, $post_id){ | |
global $post; | |
if ( $column_name == 'zasilkovna' ) { | |
echo 'Barcode'; | |
} | |
if ( $column_name == 'zasilkovna_send' ) { | |
echo 'Zásilkovna'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment