woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-ite...

49 lines
858 B
PHP
Raw Normal View History

2013-08-06 10:41:20 +00:00
<?php
/**
* Order Data.
2013-08-06 10:41:20 +00:00
*
* Functions for displaying the order items meta box.
*
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin/Meta Boxes
2013-08-06 10:41:20 +00:00
* @version 2.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
2013-08-06 10:41:20 +00:00
/**
* WC_Meta_Box_Order_Items Class.
*/
2013-08-06 10:41:20 +00:00
class WC_Meta_Box_Order_Items {
/**
* Output the metabox.
2013-08-06 10:41:20 +00:00
*/
public static function output( $post ) {
global $post, $thepostid, $theorder;
if ( ! is_int( $thepostid ) ) {
$thepostid = $post->ID;
}
2013-08-06 10:41:20 +00:00
if ( ! is_object( $theorder ) ) {
$theorder = wc_get_order( $thepostid );
}
2013-08-06 10:41:20 +00:00
$order = $theorder;
$data = get_post_meta( $post->ID );
2013-08-06 10:41:20 +00:00
include( 'views/html-order-items.php' );
2013-08-06 10:41:20 +00:00
}
/**
* Save meta box data.
2013-08-06 10:41:20 +00:00
*/
public static function save( $post_id, $post ) {
wc_save_order_items( $post_id, $_POST );
2013-08-06 10:41:20 +00:00
}
}