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:
commit
89b28fd656
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue