Skip to content
Snippets Groups Projects

Atomic - 3

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Krzysztof Dyszczyk
    Edited
    wrong.php 203 B
    
    function decrease_stock(int $product_id): void {
      $quantity = (int) get_post_meta($product_id, '_stock', true);
      update_post_meta($product_id, '_stock', $quantity - 1);
    }
    
    decrease_stock($product_id);
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment