WP_POST docs

This commit is contained in:
Mike Jolley 2015-01-20 13:20:22 +00:00
parent 5ab35bf212
commit de4129f9b2
2 changed files with 8 additions and 8 deletions

View File

@ -5,7 +5,7 @@
* The WooCommerce order class handles order data.
*
* @class WC_Order
* @uses WP_Post WP Post object
* @see WP_Post
* @version 2.2.0
* @package WooCommerce/Classes
* @category Class
@ -89,21 +89,22 @@ abstract class WC_Abstract_Order {
* This class should NOT be instantiated, but the get_order function or new WC_Order_Factory
* should be used. It is possible, but the aforementioned are preferred and are the only
* methods that will be maintained going forward.
*
* @param integer $order
*/
public function __construct( $order = '' ) {
public function __construct( $order = 0 ) {
$this->prices_include_tax = get_option('woocommerce_prices_include_tax') == 'yes' ? true : false;
$this->tax_display_cart = get_option( 'woocommerce_tax_display_cart' );
$this->display_totals_ex_tax = $this->tax_display_cart == 'excl' ? true : false;
$this->display_cart_ex_tax = $this->tax_display_cart == 'excl' ? true : false;
$this->init( $order );
}
/**
* Init/load the order object. Called from the constructor.
*
* @param string|int|WP_POST|WC_Order $order Order to init
* @uses WP_POST
* @param int|WP_POST|WC_Order $order Order to init
* @var WP_POST
*/
protected function init( $order ) {
if ( is_numeric( $order ) ) {

View File

@ -5,7 +5,7 @@
* The WooCommerce product class handles individual product data.
*
* @class WC_Product
* @uses WP_Post WP Post object
* @see WP_Post
* @version 2.1.0
* @package WooCommerce/Abstracts
* @category Abstract Class
@ -45,10 +45,9 @@ class WC_Product {
* Constructor gets the post object and sets the ID for the loaded product.
*
* @param int|WC_Product|WP_Post $product Product ID, post object, or product object
* @uses WP_POST
* @var WP_POST
*/
public function __construct( $product ) {
if ( is_numeric( $product ) ) {
$this->id = absint( $product );
$this->post = get_post( $this->id );