wc_sanitize_taxonomy_name

Sanitize taxonomy names.

Description

(string) wc_sanitize_taxonomy_name( (mixed) $taxonomy ); 

Slug format (no spaces, lowercase).

urldecode is used to reverse munging of UTF8 characters.

Returns (string)

Parameters (1)

0. $taxonomy (mixed)
The taxonomy.

Usage

  1. if ( !function_exists( 'wc_sanitize_taxonomy_name' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-formatting-functions.php'; 
  3.  
  4. // The taxonomy. 
  5. $taxonomy = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_sanitize_taxonomy_name($taxonomy); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-formatting-functions.php  
  1. function wc_sanitize_taxonomy_name( $taxonomy ) { 
  2. return apply_filters( 'sanitize_taxonomy_name', urldecode( sanitize_title( urldecode( $taxonomy ) ) ), $taxonomy );