‘pre_term_slug’ filter interrupts WordPress unique slug mechanism
-
We are having trouble with auto-generation of slugs in hierarchical taxonomies (by leaving the slug field empty). WordPress should generate a slug from the sanitized term name, and if any conflict occurs, a unique slug would be created using the term’s hierarchy.
It seems that Polylang is interfering with this mechanism using the ‘pre_term_slug’ filter: Polylang creates a slug before WordPress can detect the provided empty value. If any conflict occurs, Polylang doesn’t create a unique slug, but let’s the duplicate slug pass through and fail.
Can we update the plugin to move the ‘set_pre_term_slug’ hook later, right before saving the term to the database? Or at least provide an admin option to disable this functionality?
- The topic ‘‘pre_term_slug’ filter interrupts WordPress unique slug mechanism’ is closed to new replies.