Skip to content

Commit

Permalink
Updating docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
aldavigdis committed Mar 7, 2024
1 parent 5bfd337 commit 793ea2e
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions src/WooMetaboxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ public function __construct() {

add_action(
'woocommerce_product_options_sku',
array( __CLASS__, 'render_product_options_sku_partial' )
array( $this, 'render_product_options_sku_partial' )
);

add_action(
'save_post_product',
array( __CLASS__, 'save_product_meta' ),
10
array( $this, 'save_product_meta' ),
10,
1
);
}

Expand All @@ -49,12 +50,24 @@ public static function render_product_options_sku_partial(): void {
require __DIR__ . '/../views/product_options_sku_partial.php';
}

public static function save_product_meta( $id ): void {
self::save_price_sync_meta( $id );
self::save_stock_sync_meta( $id );
/**
* Save the NineteenEightyWoo related meta tags for a product using superglobals
*
* Fired during the `save_post_product` hook.
*
* @param int $id The post ID for the product.
*/
public function save_product_meta( int $id ): void {
$this->save_price_sync_meta( $id );
$this->save_stock_sync_meta( $id );
}

public static function save_price_sync_meta( $id ) {
/**
* Save the 1984_woo_dk_price_sync post meta from superglobals
*
* @param int $id The post ID for the product.
*/
public function save_price_sync_meta( int $id ): void {
if ( false === isset( $_POST['set_1984_woo_dk_price_sync_nonce'] ) ) {
return;
}
Expand All @@ -76,7 +89,12 @@ public static function save_price_sync_meta( $id ) {
}
}

public static function save_stock_sync_meta( $id ) {
/**
* Save the 1984_woo_dk_stock_sync post meta from superglobal
*
* @param int $id The post ID for the product.
*/
public function save_stock_sync_meta( int $id ): void {
if ( false === isset( $_POST['set_1984_woo_dk_stock_sync_nonce'] ) ) {
return;
}
Expand Down

0 comments on commit 793ea2e

Please sign in to comment.