-
-
Save Jeff2Ma/0f8746b37c139f3cf4ef 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 | |
/** | |
* Plugin Name: WooCommerce - Show order IDs | |
* Plugin URI: http://www.remicorson.com/easily-find-woocommerce-order-id/ | |
* Description: Adds a new columns to order list page to display order IDs | |
* Version: 1.0 | |
* Author: Remi Corson | |
* Author URI: http://remicorson.com | |
* Requires at least: 3.5 | |
* Tested up to: 3.5 | |
* | |
* Text Domain: - | |
* Domain Path: - | |
* | |
*/ | |
/* | |
|-------------------------------------------------------------------------- | |
| WooCommerce Order Extra Columns | |
|-------------------------------------------------------------------------- | |
*/ | |
/** | |
* Load Custom Order Columns | |
* | |
* @access public | |
* @since 1.0 | |
* @return | |
*/ | |
function woo_order_extra_columns($columns) | |
{ | |
$newcolumns = array( | |
"cb" => "<input type = \"checkbox\" />", | |
"order_ID" => esc_html__('ID', 'woocommerce'), | |
); | |
$columns = array_merge($newcolumns, $columns); | |
return $columns; | |
} | |
add_filter("manage_edit-shop_order_columns", "woo_order_extra_columns"); | |
/** | |
* Charge Order Columns Content | |
* | |
* @access public | |
* @since 1.0 | |
* @return | |
*/ | |
function woo_order_extra_columns_content($column) | |
{ | |
global $post; | |
$order_id = $post->ID; | |
switch ($column) | |
{ | |
case "order_ID": | |
echo $order_id; | |
break; | |
} | |
} | |
add_action("manage_posts_custom_column", "woo_order_extra_columns_content"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment