Adding `$default_path` parameter to `woocommerce_locate_template` filter (#52169)

Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
This commit is contained in:
Oliver Juhas 2024-10-31 08:59:18 +01:00 committed by GitHub
parent 20d210421d
commit 21c5a3d806
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 2 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
Add parameter to woocommerce_locate_template filter

View File

@ -416,8 +416,19 @@ function wc_locate_template( $template_name, $template_path = '', $default_path
}
}
// Return what we found.
return apply_filters( 'woocommerce_locate_template', $template, $template_name, $template_path );
/**
* Filter to customize the path of a given WooCommerce template.
*
* Note: the $default_path argument was added in WooCommerce 9.5.0.
*
* @param string $template Full file path of the template.
* @param string $template_name Template name.
* @param string $template_path Template path.
* @param string $template_path Default WooCommerce templates path.
*
* @since 9.5.0 $default_path argument added.
*/
return apply_filters( 'woocommerce_locate_template', $template, $template_name, $template_path, $default_path );
}
/**