woocommerce_add_to_cart_form_action
Использование
add_filter( 'woocommerce_add_to_cart_form_action', 'wp_kama_woocommerce_add_to_cart_form_action_filter' ); /** * Function for `woocommerce_add_to_cart_form_action` filter-hook. * * @param $product_permalink * * @return */ function wp_kama_woocommerce_add_to_cart_form_action_filter( $product_permalink ){ // filter... return $product_permalink; }
- $product_permalink
- -
Где вызывается хук
woocommerce_add_to_cart_form_action
woocommerce/templates/single-product/add-to-cart/simple.php 32
<form class="cart" action="<?php echo esc_url( apply_filters( 'woocommerce_add_to_cart_form_action', $product->get_permalink() ) ); ?>" method="post" enctype='multipart/form-data'>
woocommerce/templates/single-product/add-to-cart/grouped.php 24
<form class="cart grouped_form" action="<?php echo esc_url( apply_filters( 'woocommerce_add_to_cart_form_action', $product->get_permalink() ) ); ?>" method="post" enctype='multipart/form-data'>
woocommerce/templates/single-product/add-to-cart/variable.php 28
<form class="variations_form cart" action="<?php echo esc_url( apply_filters( 'woocommerce_add_to_cart_form_action', $product->get_permalink() ) ); ?>" method="post" enctype='multipart/form-data' data-product_id="<?php echo absint( $product->get_id() ); ?>" data-product_variations="<?php echo $variations_attr; // WPCS: XSS ok. ?>">
Где используется хук в WooCommerce
woocommerce/includes/class-wc-shortcodes.php 571
add_filter( 'woocommerce_add_to_cart_form_action', '__return_empty_string' );
woocommerce/includes/class-wc-shortcodes.php 654
remove_filter( 'woocommerce_add_to_cart_form_action', '__return_empty_string' );