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

WC_Post_Types::register_taxonomies() WC 1.0

Register core taxonomies.

Это метод класса: WC_Post_Types

Хуки из метода
Возвращает

Ничего (null).

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

$var = WC_Post_Types::register_taxonomies();

Код WC Post Types::register taxonomies: woocommerce/includes/class-wc-post-types.php WC 3.6.3

<?php
public static function register_taxonomies() {

	if ( ! is_blog_installed() ) {
		return;
	}

	if ( taxonomy_exists( 'product_type' ) ) {
		return;
	}

	do_action( 'woocommerce_register_taxonomy' );

	$permalinks = wc_get_permalink_structure();

	register_taxonomy(
		'product_type',
		apply_filters( 'woocommerce_taxonomy_objects_product_type', array( 'product' ) ),
		apply_filters(
			'woocommerce_taxonomy_args_product_type',
			array(
				'hierarchical'      => false,
				'show_ui'           => false,
				'show_in_nav_menus' => false,
				'query_var'         => is_admin(),
				'rewrite'           => false,
				'public'            => false,
			)
		)
	);

	register_taxonomy(
		'product_visibility',
		apply_filters( 'woocommerce_taxonomy_objects_product_visibility', array( 'product', 'product_variation' ) ),
		apply_filters(
			'woocommerce_taxonomy_args_product_visibility',
			array(
				'hierarchical'      => false,
				'show_ui'           => false,
				'show_in_nav_menus' => false,
				'query_var'         => is_admin(),
				'rewrite'           => false,
				'public'            => false,
			)
		)
	);

	register_taxonomy(
		'product_cat',
		apply_filters( 'woocommerce_taxonomy_objects_product_cat', array( 'product' ) ),
		apply_filters(
			'woocommerce_taxonomy_args_product_cat',
			array(
				'hierarchical'          => true,
				'update_count_callback' => '_wc_term_recount',
				'label'                 => __( 'Categories', 'woocommerce' ),
				'labels'                => array(
					'name'              => __( 'Product categories', 'woocommerce' ),
					'singular_name'     => __( 'Category', 'woocommerce' ),
					'menu_name'         => _x( 'Categories', 'Admin menu name', 'woocommerce' ),
					'search_items'      => __( 'Search categories', 'woocommerce' ),
					'all_items'         => __( 'All categories', 'woocommerce' ),
					'parent_item'       => __( 'Parent category', 'woocommerce' ),
					'parent_item_colon' => __( 'Parent category:', 'woocommerce' ),
					'edit_item'         => __( 'Edit category', 'woocommerce' ),
					'update_item'       => __( 'Update category', 'woocommerce' ),
					'add_new_item'      => __( 'Add new category', 'woocommerce' ),
					'new_item_name'     => __( 'New category name', 'woocommerce' ),
					'not_found'         => __( 'No categories found', 'woocommerce' ),
				),
				'show_ui'               => true,
				'query_var'             => true,
				'capabilities'          => array(
					'manage_terms' => 'manage_product_terms',
					'edit_terms'   => 'edit_product_terms',
					'delete_terms' => 'delete_product_terms',
					'assign_terms' => 'assign_product_terms',
				),
				'rewrite'               => array(
					'slug'         => $permalinks['category_rewrite_slug'],
					'with_front'   => false,
					'hierarchical' => true,
				),
			)
		)
	);

	register_taxonomy(
		'product_tag',
		apply_filters( 'woocommerce_taxonomy_objects_product_tag', array( 'product' ) ),
		apply_filters(
			'woocommerce_taxonomy_args_product_tag',
			array(
				'hierarchical'          => false,
				'update_count_callback' => '_wc_term_recount',
				'label'                 => __( 'Product tags', 'woocommerce' ),
				'labels'                => array(
					'name'                       => __( 'Product tags', 'woocommerce' ),
					'singular_name'              => __( 'Tag', 'woocommerce' ),
					'menu_name'                  => _x( 'Tags', 'Admin menu name', 'woocommerce' ),
					'search_items'               => __( 'Search tags', 'woocommerce' ),
					'all_items'                  => __( 'All tags', 'woocommerce' ),
					'edit_item'                  => __( 'Edit tag', 'woocommerce' ),
					'update_item'                => __( 'Update tag', 'woocommerce' ),
					'add_new_item'               => __( 'Add new tag', 'woocommerce' ),
					'new_item_name'              => __( 'New tag name', 'woocommerce' ),
					'popular_items'              => __( 'Popular tags', 'woocommerce' ),
					'separate_items_with_commas' => __( 'Separate tags with commas', 'woocommerce' ),
					'add_or_remove_items'        => __( 'Add or remove tags', 'woocommerce' ),
					'choose_from_most_used'      => __( 'Choose from the most used tags', 'woocommerce' ),
					'not_found'                  => __( 'No tags found', 'woocommerce' ),
				),
				'show_ui'               => true,
				'query_var'             => true,
				'capabilities'          => array(
					'manage_terms' => 'manage_product_terms',
					'edit_terms'   => 'edit_product_terms',
					'delete_terms' => 'delete_product_terms',
					'assign_terms' => 'assign_product_terms',
				),
				'rewrite'               => array(
					'slug'       => $permalinks['tag_rewrite_slug'],
					'with_front' => false,
				),
			)
		)
	);

	register_taxonomy(
		'product_shipping_class',
		apply_filters( 'woocommerce_taxonomy_objects_product_shipping_class', array( 'product', 'product_variation' ) ),
		apply_filters(
			'woocommerce_taxonomy_args_product_shipping_class',
			array(
				'hierarchical'          => false,
				'update_count_callback' => '_update_post_term_count',
				'label'                 => __( 'Shipping classes', 'woocommerce' ),
				'labels'                => array(
					'name'              => __( 'Product shipping classes', 'woocommerce' ),
					'singular_name'     => __( 'Shipping class', 'woocommerce' ),
					'menu_name'         => _x( 'Shipping classes', 'Admin menu name', 'woocommerce' ),
					'search_items'      => __( 'Search shipping classes', 'woocommerce' ),
					'all_items'         => __( 'All shipping classes', 'woocommerce' ),
					'parent_item'       => __( 'Parent shipping class', 'woocommerce' ),
					'parent_item_colon' => __( 'Parent shipping class:', 'woocommerce' ),
					'edit_item'         => __( 'Edit shipping class', 'woocommerce' ),
					'update_item'       => __( 'Update shipping class', 'woocommerce' ),
					'add_new_item'      => __( 'Add new shipping class', 'woocommerce' ),
					'new_item_name'     => __( 'New shipping class Name', 'woocommerce' ),
				),
				'show_ui'               => false,
				'show_in_quick_edit'    => false,
				'show_in_nav_menus'     => false,
				'query_var'             => is_admin(),
				'capabilities'          => array(
					'manage_terms' => 'manage_product_terms',
					'edit_terms'   => 'edit_product_terms',
					'delete_terms' => 'delete_product_terms',
					'assign_terms' => 'assign_product_terms',
				),
				'rewrite'               => false,
			)
		)
	);

	global $wc_product_attributes;

	$wc_product_attributes = array();
	$attribute_taxonomies  = wc_get_attribute_taxonomies();

	if ( $attribute_taxonomies ) {
		foreach ( $attribute_taxonomies as $tax ) {
			$name = wc_attribute_taxonomy_name( $tax->attribute_name );

			if ( $name ) {
				$tax->attribute_public          = absint( isset( $tax->attribute_public ) ? $tax->attribute_public : 1 );
				$label                          = ! empty( $tax->attribute_label ) ? $tax->attribute_label : $tax->attribute_name;
				$wc_product_attributes[ $name ] = $tax;
				$taxonomy_data                  = array(
					'hierarchical'          => false,
					'update_count_callback' => '_update_post_term_count',
					'labels'                => array(
						/* translators: %s: attribute name */
						'name'              => sprintf( _x( 'Product %s', 'Product Attribute', 'woocommerce' ), $label ),
						'singular_name'     => $label,
						/* translators: %s: attribute name */
						'search_items'      => sprintf( __( 'Search %s', 'woocommerce' ), $label ),
						/* translators: %s: attribute name */
						'all_items'         => sprintf( __( 'All %s', 'woocommerce' ), $label ),
						/* translators: %s: attribute name */
						'parent_item'       => sprintf( __( 'Parent %s', 'woocommerce' ), $label ),
						/* translators: %s: attribute name */
						'parent_item_colon' => sprintf( __( 'Parent %s:', 'woocommerce' ), $label ),
						/* translators: %s: attribute name */
						'edit_item'         => sprintf( __( 'Edit %s', 'woocommerce' ), $label ),
						/* translators: %s: attribute name */
						'update_item'       => sprintf( __( 'Update %s', 'woocommerce' ), $label ),
						/* translators: %s: attribute name */
						'add_new_item'      => sprintf( __( 'Add new %s', 'woocommerce' ), $label ),
						/* translators: %s: attribute name */
						'new_item_name'     => sprintf( __( 'New %s', 'woocommerce' ), $label ),
						/* translators: %s: attribute name */
						'not_found'         => sprintf( __( 'No &quot;%s&quot; found', 'woocommerce' ), $label ),
						/* translators: %s: attribute name */
						'back_to_items'     => sprintf( __( '&larr; Back to "%s" attributes', 'woocommerce' ), $label ),
					),
					'show_ui'               => true,
					'show_in_quick_edit'    => false,
					'show_in_menu'          => false,
					'meta_box_cb'           => false,
					'query_var'             => 1 === $tax->attribute_public,
					'rewrite'               => false,
					'sort'                  => false,
					'public'                => 1 === $tax->attribute_public,
					'show_in_nav_menus'     => 1 === $tax->attribute_public && apply_filters( 'woocommerce_attribute_show_in_nav_menus', false, $name ),
					'capabilities'          => array(
						'manage_terms' => 'manage_product_terms',
						'edit_terms'   => 'edit_product_terms',
						'delete_terms' => 'delete_product_terms',
						'assign_terms' => 'assign_product_terms',
					),
				);

				if ( 1 === $tax->attribute_public && sanitize_title( $tax->attribute_name ) ) {
					$taxonomy_data['rewrite'] = array(
						'slug'         => trailingslashit( $permalinks['attribute_rewrite_slug'] ) . sanitize_title( $tax->attribute_name ),
						'with_front'   => false,
						'hierarchical' => true,
					);
				}

				register_taxonomy( $name, apply_filters( "woocommerce_taxonomy_objects_{$name}", array( 'product' ) ), apply_filters( "woocommerce_taxonomy_args_{$name}", $taxonomy_data ) );
			}
		}
	}

	do_action( 'woocommerce_after_register_taxonomy' );
}