Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Bump woocommerce/woocommerce-sniffs from 0.1.0 to 0.1.3 (#8031)
Browse files Browse the repository at this point in the history
* Update WooCommerce Sniffs to version 0.1.3

* Add since versioning to all hooks to comply with the updated standards.

* Add since tags for hooks.

* Add the since tags to additional actions and filters

* Update build hook documentation via
> @woocommerce/[email protected] prebuild:docs /Users/patriciahillebrandt/Woo/plugins/woocommerce-blocks
> rimraf docs/extensibility/actions.md & rimraf docs/extensibility/filters.md

> @woocommerce/[email protected] build:docs /Users/patriciahillebrandt/Woo/plugins/woocommerce-blocks
> ./vendor/bin/wp-hooks-generator --input=src --output=bin/hook-docs/data && node ./bin/hook-docs

Scanning for files...
Found 212 files. Parsing hooks...
Done
Let's create some docs!
Generating Action Docs...
Creating file docs/third-party-developers/extensibility/hooks/actions.md...
Done!
Generating Filter Docs...
Creating file docs/third-party-developers/extensibility/hooks/filters.md...
Done!

> @woocommerce/[email protected] postbuild:docs /Users/patriciahillebrandt/Woo/plugins/woocommerce-blocks
> ./bin/add-doc-footer.sh

* Add since tag for additional hooks.

* build hook documentation

* Update QuantityLimits filter_value docblock.

* Add the @SInCE tags to recently added hooks.

* Add tag for the woocommerce_loop_add_to_cart_args filter.

* Update hooks documentation

---------

Co-authored-by: Niels Lange <[email protected]>
  • Loading branch information
nefeline and nielslange authored Feb 24, 2023
1 parent cd7aa31 commit fb3d187
Show file tree
Hide file tree
Showing 47 changed files with 876 additions and 64 deletions.
261 changes: 246 additions & 15 deletions bin/hook-docs/data/actions.json

Large diffs are not rendered by default.

230 changes: 217 additions & 13 deletions bin/hook-docs/data/filters.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"require-dev": {
"wp-phpunit/wp-phpunit": "^6.0",
"woocommerce/woocommerce-sniffs": "0.1.0",
"woocommerce/woocommerce-sniffs": "0.1.3",
"yoast/phpunit-polyfills": "^1.0",
"mockery/mockery": "^1.4",
"wp-hooks/generator": "^0.9.0"
Expand Down
22 changes: 11 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,4 @@ The following tutorials from [developer.woocommerce.com](https://developer.wooco
🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/README.md)

<!-- /FEEDBACK -->

1 change: 1 addition & 0 deletions docs/contributors/contributing/css-build-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ Webpack config is split between several files, some relevant ones for the CSS bu
🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/contributing/css-build-system.md)

<!-- /FEEDBACK -->

1 change: 1 addition & 0 deletions docs/contributors/contributing/folder-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,4 @@ This file is inspired by the great work of @JustinyAhin and @gziolo in <https://
🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/contributing/folder-structure.md)

<!-- /FEEDBACK -->

1 change: 1 addition & 0 deletions docs/contributors/contributing/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,4 @@ To find out more about how to run automated JavaScript tests, check out the docu
🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/contributing/getting-started.md)

<!-- /FEEDBACK -->

1 change: 1 addition & 0 deletions docs/contributors/contributing/javascript-build-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,4 @@ Webpack config is split between several files:
🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/contributing/javascript-build-system.md)

<!-- /FEEDBACK -->

1 change: 1 addition & 0 deletions docs/third-party-developers/extensibility/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ In addition to the reference material below, [please see the `block-checkout` pa
🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/README.md)

<!-- /FEEDBACK -->

Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,4 @@ The error will also be shown in your console.
🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/checkout-block/available-filters.md)

<!-- /FEEDBACK -->

Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,13 @@ The `checkPaymentMethodsCanPay()` [function](https://github.com/woocommerce/wooc
- [Here](https://github.com/woocommerce/woocommerce-blocks/blob/4af2c0916a936369be8a4f0044683b90b3af4f0d/assets/js/data/cart/index.ts#L46-L57), once the cart loads, we want to be able to display express payment methods, so we need to validate them first.
- [Here](https://github.com/woocommerce/woocommerce-blocks/blob/4af2c0916a936369be8a4f0044683b90b3af4f0d/assets/js/data/cart/index.ts#L42-L43), once the cart changes, we may want to enable/disable certain payment methods
- [Here](https://github.com/woocommerce/woocommerce-blocks/blob/4af2c0916a936369be8a4f0044683b90b3af4f0d/assets/js/data/checkout/index.ts#L44-L49), once the checkout loads, we want to verify all registered payment methods
<!-- FEEDBACK -->

---

[We're hiring!](https://woocommerce.com/careers/) Come work with us!

🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/checkout-block/how-checkout-processes-an-order.md)

<!-- /FEEDBACK -->

Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,4 @@ As an example, you can see how the Stripe extension adds it's integration in thi
🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md)

<!-- /FEEDBACK -->

Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ const isShippingRateBeingSelected = store.isShippingRateBeingSelected();

[We're hiring!](https://woocommerce.com/careers/) Come work with us!

🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/data-store/checkout.md)
🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/data-store/cart.md)

<!-- /FEEDBACK -->

Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,4 @@ This is true when the total is being re-calculated for the order. There are nume
🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/data-store/checkout.md)

<!-- /FEEDBACK -->

Original file line number Diff line number Diff line change
Expand Up @@ -478,3 +478,4 @@ const expressPaymentMethodsInitialized =
🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/data-store/payment.md)

<!-- /FEEDBACK -->

77 changes: 73 additions & 4 deletions docs/third-party-developers/extensibility/hooks/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- [woocommerce_rest_checkout_process_payment_with_context](#woocommerce_rest_checkout_process_payment_with_context)
- [woocommerce_shop_loop](#woocommerce_shop_loop)
- [woocommerce_store_api_cart_errors](#woocommerce_store_api_cart_errors)
- [woocommerce_store_api_cart_select_shipping_rate](#woocommerce_store_api_cart_select_shipping_rate)
- [woocommerce_store_api_cart_update_customer_from_request](#woocommerce_store_api_cart_update_customer_from_request)
- [woocommerce_store_api_cart_update_order_from_request](#woocommerce_store_api_cart_update_order_from_request)
- [woocommerce_store_api_checkout_order_processed](#woocommerce_store_api_checkout_order_processed)
Expand All @@ -39,13 +40,15 @@
- [woocommerce_store_api_rate_limit_exceeded](#woocommerce_store_api_rate_limit_exceeded)
- [woocommerce_store_api_validate_add_to_cart](#woocommerce_store_api_validate_add_to_cart)
- [woocommerce_store_api_validate_cart_item](#woocommerce_store_api_validate_cart_item)
- [woocommerce_{$product->get_type()}_add_to_cart](#woocommerce_-product--get_type-_add_to_cart)
- [{$hook}](#-hook)

---

## deprecated_function_run



Fires when a deprecated function is called.

```php
do_action( 'deprecated_function_run' )
Expand Down Expand Up @@ -249,8 +252,8 @@ do_action( 'woocommerce_blocks_cart_enqueue_data' )
### Source


- [BlockTypes/Cart.php](../../../../src/BlockTypes/Cart.php)
- [BlockTypes/MiniCart.php](../../../../src/BlockTypes/MiniCart.php)
- [BlockTypes/Cart.php](../../../../src/BlockTypes/Cart.php)

---

Expand Down Expand Up @@ -578,6 +581,34 @@ add_action( 'woocommerce_store_api_cart_errors', 'my_function_callback', 10 );

---

## woocommerce_store_api_cart_select_shipping_rate


Fires an action after a shipping method has been chosen for package(s) via the Store API.

```php
do_action( 'woocommerce_store_api_cart_select_shipping_rate', string|null $package_id, string $rate_id, \WP_REST_Request $request )
```

### Description

<p>This allows extensions to perform addition actions after a shipping method has been chosen, but before the cart totals are recalculated.</p>

### Parameters

| Argument | Type | Description |
| -------- | ---- | ----------- |
| $package_id | string, null | The sanitized ID of the package being updated. Null if all packages are being updated. |
| $rate_id | string | The sanitized chosen rate ID for the package. |
| $request | \WP_REST_Request | Full details about the request. |

### Source


- [StoreApi/Routes/V1/CartSelectShippingRate.php](../../../../src/StoreApi/Routes/V1/CartSelectShippingRate.php)

---

## woocommerce_store_api_cart_update_customer_from_request


Expand Down Expand Up @@ -755,12 +786,18 @@ do_action( 'woocommerce_store_api_checkout_update_order_meta', \WC_Order $order
## woocommerce_store_api_rate_limit_exceeded



Fires when the rate limit is exceeded.

```php
do_action( 'woocommerce_store_api_rate_limit_exceeded' )
do_action( 'woocommerce_store_api_rate_limit_exceeded', string $ip_address )
```

### Parameters

| Argument | Type | Description |
| -------- | ---- | ----------- |
| $ip_address | string | The IP address of the request. |

### Source


Expand Down Expand Up @@ -816,6 +853,38 @@ do_action( 'woocommerce_store_api_validate_cart_item', \WC_Product $product, arr

- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php)

---

## woocommerce_{$product->get_type()}_add_to_cart


Trigger the single product add to cart action for each product type.

```php
do_action( 'woocommerce_{$product->get_type()}_add_to_cart' )
```

### Source


- [BlockTypes/AddToCartForm.php](../../../../src/BlockTypes/AddToCartForm.php)

---

## {$hook}


Action to render the content of a hook.

```php
do_action( '{$hook}' )
```

### Source


- [Templates/BlockTemplatesCompatibility.php](../../../../src/Templates/BlockTemplatesCompatibility.php)

---
<!-- FEEDBACK -->

Expand Down
Loading

0 comments on commit fb3d187

Please sign in to comment.