WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

woocommerce_product_subcategories() WC 1.0

Запрещена (устарела) с версии 3.3.1 @todo Add a notice in a future version.. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.

This is a legacy function which used to check if we needed to display subcats and then output them. It was called by templates.

From 3.3 onwards this is all handled via hooks and the woocommerce_maybe_show_product_subcategories function.

Since some templates have not updated compatibility, to avoid showing incorrect categories this function has been deprecated and will return nothing. Replace usage with woocommerce_output_product_categories to render the category list manually.

This is a legacy function which also checks if things should display. Themes no longer need to call these functions. It's all done via hooks.

Хуков нет.

Возвращает

null/true/false.

Использование

woocommerce_product_subcategories( $args );
$args(массив)
Arguments.
По умолчанию: array()

Список изменений

Устарела с 3.3.1 @todo Add a notice in a future version.

Код woocommerce_product_subcategories() WC 4.6.0

<?php
function woocommerce_product_subcategories( $args = array() ) {
	$defaults = array(
		'before'        => '',
		'after'         => '',
		'force_display' => false,
	);

	$args = wp_parse_args( $args, $defaults );

	if ( $args['force_display'] ) {
		// We can still render if display is forced.
		woocommerce_output_product_categories(
			array(
				'before'    => $args['before'],
				'after'     => $args['after'],
				'parent_id' => is_product_category() ? get_queried_object_id() : 0,
			)
		);
		return true;
	} else {
		// Output nothing. woocommerce_maybe_show_product_subcategories will handle the output of cats.
		$display_type = woocommerce_get_loop_display_mode();

		if ( 'subcategories' === $display_type ) {
			// This removes pagination and products from display for themes not using wc_get_loop_prop in their product loops. @todo Remove in future major version.
			global $wp_query;

			if ( $wp_query->is_main_query() ) {
				$wp_query->post_count    = 0;
				$wp_query->max_num_pages = 0;
			}
		}

		return 'subcategories' === $display_type || 'both' === $display_type;
	}
}