Created
April 8, 2024 10:23
-
-
Save iworks/f57af41affd6243ab7b1b1335968f48f to your computer and use it in GitHub Desktop.
class/paczkomaty-inpost.php - fix
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
50c50 | |
< add_action( 'save_post', [ $this, 'save_product_data' ], 1, 3 ); | |
--- | |
> add_action( 'save_post', [ $this, 'save_product_data' ], 1 ); | |
875,877c875,878 | |
< public function save_product_data( $post_id, $post, $update ) { | |
< if ( isset( $post ) && 'product' === $post->post_type && $post_id ) { | |
< $product = wc_get_product( $post_id ); | |
--- | |
> public function save_product_data() { | |
> global $post; | |
> if ( isset( $post ) && 'product' === $post->post_type && $post->ID ) { | |
> $product = wc_get_product( $post->ID ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment