[wp-trac] [WordPress Trac] #20783: Add filter to wp_unique_term_slug()

WordPress Trac wp-trac at lists.automattic.com
Fri Jun 29 20:01:02 UTC 2012


#20783: Add filter to wp_unique_term_slug()
-------------------------+------------------------------
 Reporter:  bolo1988     |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Taxonomy     |     Version:  3.3.2
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------------------

Comment (by coffee2code):

 Patch [attachment:20783.2.diff] brings `wp_unique_term_slug()` into
 greater alignment with its post counterpart, `wp_unique_post_slug()`:

 * Calls `wp_unique_term_slug` on an earlier return of $slug
 * Adds `wp_unique_term_slug_is_bad_hierarchical_slug` and
 `wp_unique_term_slug_is_bad_flat_slug` filters as introduced in [16960]
 for #15726 to allow filtering of potentially bad hierarchical or flat
 slugs.
 * Adds `pre_wp_unique_term_slug` filter early in function to short-circuit
 add the db queries, filters, etc if the hooking function's intent is to
 fully implement its own slug handling (the only thing not already part of
 `wp_unique_post_slug()`, but proposed in #21112)

 (The addition of the *is_bad* slugs prompted by #21093, which was closed
 in favor of this ticket.)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20783#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list