@@ 55-58 (lines=4) @@ | ||
52 | * @return bool |
|
53 | */ |
|
54 | function wc_has_notice( $message, $notice_type = 'success' ) { |
|
55 | if ( ! did_action( 'woocommerce_init' ) ) { |
|
56 | wc_doing_it_wrong( __FUNCTION__, __( 'This function should not be called before woocommerce_init.', 'woocommerce' ), '2.3' ); |
|
57 | return false; |
|
58 | } |
|
59 | ||
60 | $notices = WC()->session->get( 'wc_notices', array() ); |
|
61 | $notices = isset( $notices[ $notice_type ] ) ? $notices[ $notice_type ] : array(); |
@@ 56-60 (lines=5) @@ | ||
53 | * @return WC_Product|null|false |
|
54 | */ |
|
55 | function wc_get_product( $the_product = false, $deprecated = array() ) { |
|
56 | if ( ! did_action( 'woocommerce_init' ) ) { |
|
57 | /* translators: 1: wc_get_product 2: woocommerce_init */ |
|
58 | wc_doing_it_wrong( __FUNCTION__, sprintf( __( '%1$s should not be called before the %2$s action.', 'woocommerce' ), 'wc_get_product', 'woocommerce_init' ), '2.5' ); |
|
59 | return false; |
|
60 | } |
|
61 | if ( ! empty( $deprecated ) ) { |
|
62 | wc_deprecated_argument( 'args', '3.0', 'Passing args to wc_get_product is deprecated. If you need to force a type, construct the product class directly.' ); |
|
63 | } |