woocommerce_variation_option_name хук-фильтрWC 1.0

This handles < 2.4.0 bw compatibility where text attributes were not sanitized.

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

add_filter( 'woocommerce_variation_option_name', 'wp_kama_woocommerce_variation_option_name_filter', 10, 4 );

/**
 * Function for `woocommerce_variation_option_name` filter-hook.
 * 
 * @param  $option    
 * @param  $null      
 * @param  $attribute 
 * @param  $product   
 *
 * @return 
 */
function wp_kama_woocommerce_variation_option_name_filter( $option, $null, $attribute, $product ){

	// filter...
	return $option;
}
$option
-
$null
-
$attribute
-
$product
-

Где вызывается хук

wc_dropdown_variation_attribute_options()
woocommerce_variation_option_name
CartItemSchema::format_variation_data()
woocommerce_variation_option_name
wc_get_formatted_cart_item_data()
woocommerce_variation_option_name
woocommerce/includes/wc-template-functions.php 3133
$html    .= '<option value="' . esc_attr( $option ) . '" ' . $selected . '>' . esc_html( apply_filters( 'woocommerce_variation_option_name', $option, null, $attribute, $product ) ) . '</option>';
woocommerce/packages/woocommerce-blocks/src/StoreApi/Schemas/V1/CartItemSchema.php 430
$value = apply_filters( 'woocommerce_variation_option_name', $value, null, $taxonomy, $product );
woocommerce/includes/admin/meta-boxes/views/html-variation-admin.php 39
<option <?php selected( $selected_value, $option->slug ); ?> value="<?php echo esc_attr( $option->slug ); ?>"><?php echo esc_html( apply_filters( 'woocommerce_variation_option_name', $option->name, $option, $attribute->get_name(), $product_object ) ); ?></option>
woocommerce/includes/admin/meta-boxes/views/html-variation-admin.php 43
<option <?php selected( $selected_value, $option ); ?> value="<?php echo esc_attr( $option ); ?>"><?php echo esc_html( apply_filters( 'woocommerce_variation_option_name', $option, null, $attribute->get_name(), $product_object ) ); ?></option>
woocommerce/includes/admin/meta-boxes/views/html-product-data-variations.php 36
<option <?php selected( $selected_value, $option->slug ); ?> value="<?php echo esc_attr( $option->slug ); ?>"><?php echo esc_html( apply_filters( 'woocommerce_variation_option_name', $option->name, $option, $attribute->get_name(), $product_object ) ); ?></option>
woocommerce/includes/admin/meta-boxes/views/html-product-data-variations.php 40
<option <?php selected( $selected_value, $option ); ?> value="<?php echo esc_attr( $option ); ?>"><?php echo esc_html( apply_filters( 'woocommerce_variation_option_name', $option, null, $attribute->get_name(), $product_object ) ); ?></option>
woocommerce/includes/wc-template-functions.php 3126
$html .= '<option value="' . esc_attr( $term->slug ) . '" ' . selected( sanitize_title( $args['selected'] ), $term->slug, false ) . '>' . esc_html( apply_filters( 'woocommerce_variation_option_name', $term->name, $term, $attribute, $product ) ) . '</option>';
woocommerce/includes/wc-template-functions.php 3721
$value = apply_filters( 'woocommerce_variation_option_name', $value, null, $taxonomy, $cart_item['data'] );

Где используется хук в WooCommerce

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