| @@ 98-104 (lines=7) @@ | ||
| 95 | * |
|
| 96 | * @since 2.1 |
|
| 97 | */ |
|
| 98 | function wc_clear_notices() { |
|
| 99 | if ( ! did_action( 'woocommerce_init' ) ) { |
|
| 100 | _doing_it_wrong( __FUNCTION__, __( 'This function should not be called before woocommerce_init.', 'woocommerce' ), '2.3' ); |
|
| 101 | return; |
|
| 102 | } |
|
| 103 | WC()->session->set( 'wc_notices', null ); |
|
| 104 | } |
|
| 105 | ||
| 106 | /** |
|
| 107 | * Prints messages and errors which are stored in the session, then clears them. |
|
| @@ 24-30 (lines=7) @@ | ||
| 21 | * @param array $args (default: array()) Contains all arguments to be used to get this product. |
|
| 22 | * @return WC_Product |
|
| 23 | */ |
|
| 24 | function wc_get_product( $the_product = false, $args = array() ) { |
|
| 25 | if ( ! did_action( 'woocommerce_init' ) ) { |
|
| 26 | _doing_it_wrong( __FUNCTION__, __( 'wc_get_product should not be called before the woocommerce_init action.', 'woocommerce' ), '2.5' ); |
|
| 27 | return false; |
|
| 28 | } |
|
| 29 | return WC()->product_factory->get_product( $the_product, $args ); |
|
| 30 | } |
|
| 31 | ||
| 32 | /** |
|
| 33 | * Update a product's stock amount. |
|