Merge pull request #14938 from woocommerce/fix/14920

wc_attribute_taxonomy_id_by_name should use wc_sanitize_taxonomy_name to prevent breaking special chars
This commit is contained in:
Claudio Sanches 2017-05-08 12:12:34 -03:00 committed by GitHub
commit 89b28fd656
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ function wc_attribute_taxonomy_name_by_id( $attribute_id ) {
* @return int
*/
function wc_attribute_taxonomy_id_by_name( $name ) {
$name = str_replace( 'pa_', '', sanitize_title( $name ) );
$name = str_replace( 'pa_', '', wc_sanitize_taxonomy_name( $name ) );
$taxonomies = wp_list_pluck( wc_get_attribute_taxonomies(), 'attribute_id', 'attribute_name' );
return isset( $taxonomies[ $name ] ) ? (int) $taxonomies[ $name ] : 0;