Skip to content

Commit 5c1ae76

Browse files
committed
fix: sanitize taxonomy slugs before registering custom taxonomies
1 parent c479c76 commit 5c1ae76

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

includes/class-cpt.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ private static function get_taxonomy_labels( string $singular, string $plural ):
197197
*/
198198
public static function register_taxonomies() {
199199
// Get taxonomy slugs from options.
200-
$catslug = \wzkb_get_option( 'category_slug', 'kb/section' );
201-
$tagslug = \wzkb_get_option( 'tag_slug', 'kb/tags' );
202-
$productslug = \wzkb_get_option( 'product_slug', 'kb/products' );
200+
$catslug = sanitize_title( \wzkb_get_option( 'category_slug', 'kb/section' ) );
201+
$tagslug = sanitize_title( \wzkb_get_option( 'tag_slug', 'kb/tags' ) );
202+
$productslug = sanitize_title( \wzkb_get_option( 'product_slug', 'kb/products' ) );
203203

204204
// Register products taxonomy first.
205205
$product_args = self::get_taxonomy_base_args( $productslug, false );

0 commit comments

Comments
 (0)