Skip to content

Commit 1e9180b

Browse files
committed
Generate stubs for WooCommerce 7.8.0
1 parent 55edb87 commit 1e9180b

File tree

3 files changed

+648
-61
lines changed

3 files changed

+648
-61
lines changed

source/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"ext-json": "*",
77
"ext-mbstring": "*",
88
"ext-openssl": "*",
9-
"woocommerce/woocommerce": "7.7.2"
9+
"woocommerce/woocommerce": "7.8.0"
1010
},
1111
"minimum-stability": "stable",
1212
"extra": {

woocommerce-packages-stubs.php

Lines changed: 193 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6994,6 +6994,14 @@ class AttributeFilter extends \Automattic\WooCommerce\Blocks\BlockTypes\Abstract
69946994
protected function enqueue_data(array $attributes = [])
69956995
{
69966996
}
6997+
/**
6998+
* Get the frontend script handle for this block type.
6999+
*
7000+
* @param string $key Data to get, or default to everything.
7001+
*/
7002+
protected function get_block_type_script($key = null)
7003+
{
7004+
}
69977005
}
69987006
/**
69997007
* CatalogSorting class.
@@ -8579,6 +8587,30 @@ class MiniCartTitleBlock extends \Automattic\WooCommerce\Blocks\BlockTypes\Abstr
85798587
*/
85808588
protected $block_name = 'mini-cart-title-block';
85818589
}
8590+
/**
8591+
* MiniCartTitleItemsCounterBlock class.
8592+
*/
8593+
class MiniCartTitleItemsCounterBlock extends \Automattic\WooCommerce\Blocks\BlockTypes\AbstractInnerBlock
8594+
{
8595+
/**
8596+
* Block name.
8597+
*
8598+
* @var string
8599+
*/
8600+
protected $block_name = 'mini-cart-title-items-counter-block';
8601+
}
8602+
/**
8603+
* MiniCartTitleLabelBlock class.
8604+
*/
8605+
class MiniCartTitleLabelBlock extends \Automattic\WooCommerce\Blocks\BlockTypes\AbstractInnerBlock
8606+
{
8607+
/**
8608+
* Block name.
8609+
*
8610+
* @var string
8611+
*/
8612+
protected $block_name = 'mini-cart-title-label-block';
8613+
}
85828614
/**
85838615
* PriceFilter class.
85848616
*/
@@ -8992,9 +9024,10 @@ private function render_anchor($product, $on_sale_badge, $product_image, $attrib
89929024
* Render Image.
89939025
*
89949026
* @param \WC_Product $product Product object.
9027+
* @param array $attributes Parsed attributes.
89959028
* @return string
89969029
*/
8997-
private function render_image($product)
9030+
private function render_image($product, $attributes)
89989031
{
89999032
}
90009033
/**
@@ -9308,6 +9341,17 @@ private function get_on_sale_products_query()
93089341
private function get_custom_orderby_query($orderby)
93099342
{
93109343
}
9344+
/**
9345+
* Apply the query only to a subset of products
9346+
*
9347+
* @param array $query The query.
9348+
* @param array $ids Array of selected product ids.
9349+
*
9350+
* @return array
9351+
*/
9352+
private function filter_query_to_only_include_ids($query, $ids)
9353+
{
9354+
}
93119355
/**
93129356
* Return the `tax_query` for the requested attributes
93139357
*
@@ -9553,6 +9597,15 @@ class ProductRating extends \Automattic\WooCommerce\Blocks\BlockTypes\AbstractBl
95539597
protected function get_block_type_supports()
95549598
{
95559599
}
9600+
/**
9601+
* Get the block's attributes.
9602+
*
9603+
* @param array $attributes Block attributes. Default empty array.
9604+
* @return array Block attributes merged with defaults.
9605+
*/
9606+
private function parse_attributes($attributes)
9607+
{
9608+
}
95569609
/**
95579610
* Overwrite parent method to prevent script registration.
95589611
*
@@ -9568,17 +9621,6 @@ protected function register_block_type_assets()
95689621
protected function get_block_type_uses_context()
95699622
{
95709623
}
9571-
/**
9572-
* Filter the output from wc_get_rating_html.
9573-
*
9574-
* @param string $html Star rating markup. Default empty string.
9575-
* @param float $rating Rating being shown.
9576-
* @param int $count Total number of ratings.
9577-
* @return string
9578-
*/
9579-
public function filter_rating_html($html, $rating, $count)
9580-
{
9581-
}
95829624
/**
95839625
* Include and render the block.
95849626
*
@@ -9808,15 +9850,6 @@ class ProductStockIndicator extends \Automattic\WooCommerce\Blocks\BlockTypes\Ab
98089850
* @var string
98099851
*/
98109852
protected $api_version = '2';
9811-
/**
9812-
* Get block supports. Shared with the frontend.
9813-
* IMPORTANT: If you change anything here, make sure to update the JS file too.
9814-
*
9815-
* @return array
9816-
*/
9817-
protected function get_block_type_supports()
9818-
{
9819-
}
98209853
/**
98219854
* Register script and style assets for the block type before it is registered.
98229855
*
@@ -10027,6 +10060,14 @@ class RatingFilter extends \Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlo
1002710060
*/
1002810061
protected $block_name = 'rating-filter';
1002910062
const RATING_QUERY_VAR = 'rating_filter';
10063+
/**
10064+
* Get the frontend script handle for this block type.
10065+
*
10066+
* @param string $key Data to get, or default to everything.
10067+
*/
10068+
protected function get_block_type_script($key = null)
10069+
{
10070+
}
1003010071
}
1003110072
/**
1003210073
* RelatedProducts class.
@@ -10104,9 +10145,10 @@ private function is_related_products_block($block)
1010410145
* Get related products ids.
1010510146
* The logic is copied from the core function woocommerce_related_products. https://github.com/woocommerce/woocommerce/blob/ca49caabcba84ce9f60a03c6d3534ec14b350b80/plugins/woocommerce/includes/wc-template-functions.php/#L2039-L2074
1010610147
*
10148+
* @param number $product_per_page Products per page.
1010710149
* @return array Products ids.
1010810150
*/
10109-
private function get_related_products_ids()
10151+
private function get_related_products_ids($product_per_page = 5)
1011010152
{
1011110153
}
1011210154
}
@@ -10297,6 +10339,14 @@ protected function enqueue_data(array $stock_statuses = [])
1029710339
public static function get_stock_status_query_var_values()
1029810340
{
1029910341
}
10342+
/**
10343+
* Get the frontend script handle for this block type.
10344+
*
10345+
* @param string $key Data to get, or default to everything.
10346+
*/
10347+
protected function get_block_type_script($key = null)
10348+
{
10349+
}
1030010350
}
1030110351
/**
1030210352
* StoreNotices class.
@@ -12338,6 +12388,12 @@ class ShippingController
1233812388
* @var AssetDataRegistry
1233912389
*/
1234012390
protected $asset_data_registry;
12391+
/**
12392+
* Whether local pickup is enabled.
12393+
*
12394+
* @var bool
12395+
*/
12396+
private $local_pickup_enabled;
1234112397
/**
1234212398
* Constructor.
1234312399
*
@@ -14479,6 +14535,16 @@ private function process_payment(\WP_REST_Request $request, \Automattic\WooComme
1447914535
private function get_request_payment_method_id(\WP_REST_Request $request)
1448014536
{
1448114537
}
14538+
/**
14539+
* Gets the chosen payment method title from the request.
14540+
*
14541+
* @throws RouteException On error.
14542+
* @param \WP_REST_Request $request Request object.
14543+
* @return string
14544+
*/
14545+
private function get_request_payment_method_title(\WP_REST_Request $request)
14546+
{
14547+
}
1448214548
/**
1448314549
* Gets the chosen payment method from the request.
1448414550
*
@@ -15018,6 +15084,66 @@ protected function get_route_response(\WP_REST_Request $request)
1501815084
{
1501915085
}
1502015086
}
15087+
/**
15088+
* ProductsBySlug class.
15089+
*/
15090+
class ProductsBySlug extends \Automattic\WooCommerce\StoreApi\Routes\V1\AbstractRoute
15091+
{
15092+
/**
15093+
* The route identifier.
15094+
*
15095+
* @var string
15096+
*/
15097+
const IDENTIFIER = 'products-by-slug';
15098+
/**
15099+
* The routes schema.
15100+
*
15101+
* @var string
15102+
*/
15103+
const SCHEMA_TYPE = 'product';
15104+
/**
15105+
* Get the path of this REST route.
15106+
*
15107+
* @return string
15108+
*/
15109+
public function get_path()
15110+
{
15111+
}
15112+
/**
15113+
* Get method arguments for this REST route.
15114+
*
15115+
* @return array An array of endpoints.
15116+
*/
15117+
public function get_args()
15118+
{
15119+
}
15120+
/**
15121+
* Get a single item.
15122+
*
15123+
* @throws RouteException On error.
15124+
* @param \WP_REST_Request $request Request object.
15125+
* @return \WP_REST_Response
15126+
*/
15127+
protected function get_route_response(\WP_REST_Request $request)
15128+
{
15129+
}
15130+
/**
15131+
* Get a product by slug.
15132+
*
15133+
* @param string $slug The slug of the product.
15134+
*/
15135+
public function get_product_by_slug($slug)
15136+
{
15137+
}
15138+
/**
15139+
* Get a product variation by slug.
15140+
*
15141+
* @param string $slug The slug of the product variation.
15142+
*/
15143+
private function get_product_variation_by_slug($slug)
15144+
{
15145+
}
15146+
}
1502115147
}
1502215148
namespace Automattic\WooCommerce\StoreApi {
1502315149
/**
@@ -17209,6 +17335,14 @@ private static function from_base_64_url(string $string)
1720917335
*/
1721017336
class LocalPickupUtils
1721117337
{
17338+
/**
17339+
* Checks if WC Blocks local pickup is enabled.
17340+
*
17341+
* @return bool True if local pickup is enabled.
17342+
*/
17343+
public static function is_local_pickup_enabled()
17344+
{
17345+
}
1721217346
/**
1721317347
* Gets a list of payment method ids that support the 'local-pickup' feature.
1721417348
*
@@ -17607,13 +17741,34 @@ private function generate_stock_status_count_query($status, $product_query_sql,
1760717741
{
1760817742
}
1760917743
/**
17610-
* Get attribute counts for the current products.
17744+
* Get terms list for a given taxonomy.
1761117745
*
17612-
* @param \WP_REST_Request $request The request object.
17613-
* @param array $attributes Attributes to count, either names or ids.
17614-
* @return array termId=>count pairs.
17746+
* @param string $taxonomy Taxonomy name.
17747+
*
17748+
* @return array
17749+
*/
17750+
public function get_terms_list(string $taxonomy)
17751+
{
17752+
}
17753+
/**
17754+
* Get the empty terms list for a given taxonomy.
17755+
*
17756+
* @param string $taxonomy Taxonomy name.
17757+
*
17758+
* @return array
17759+
*/
17760+
public function get_empty_terms_list(string $taxonomy)
17761+
{
17762+
}
17763+
/**
17764+
* Get attribute and meta counts.
17765+
*
17766+
* @param WP_REST_Request $request Request data.
17767+
* @param string $filtered_attribute The attribute to count.
17768+
*
17769+
* @return array
1761517770
*/
17616-
public function get_attribute_counts($request, $attributes = [])
17771+
public function get_attribute_counts($request, $filtered_attribute)
1761717772
{
1761817773
}
1761917774
/**
@@ -18645,6 +18800,17 @@ public static function template_has_title($template)
1864518800
public static function template_has_legacy_template_block($template)
1864618801
{
1864718802
}
18803+
/**
18804+
* Gets the templates saved in the database.
18805+
*
18806+
* @param array $slugs An array of slugs to retrieve templates for.
18807+
* @param string $template_type wp_template or wp_template_part.
18808+
*
18809+
* @return int[]|\WP_Post[] An array of found templates.
18810+
*/
18811+
public static function get_block_templates_from_db($slugs = array(), $template_type = 'wp_template')
18812+
{
18813+
}
1864818814
}
1864918815
/**
1865018816
* BlocksWpQuery query.

0 commit comments

Comments
 (0)