[wp-trac] [WordPress Trac] #31568: Add a 2nd parameter to 'editable_slug' filter for context

WordPress Trac noreply at wordpress.org
Mon Mar 9 05:43:00 UTC 2015


#31568: Add a 2nd parameter to 'editable_slug' filter for context
----------------------------+-----------------------------
 Reporter:  MikeSchinkel    |      Owner:
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Rewrite Rules   |    Version:  trunk
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 I am finding cases where I ideally would prefer to know the explicit
 context for an editable slug rather than have to depend on global context,
 which in certain cases could be wrong.

 The `'editable_slug'` filter processes the slugs for `$post` and `$tag`
 objects where it is used in core so the attached patch adds in a 2nd
 parameter when calling `apply_filters( 'editable_slug', $slug )` in each
 of the seven (7) places in WP core  where the filter is used.

 The primary benefit of this patch will be to allow plugins and theme
 authors to write more robust code that will not fail during the edge cases
 where the global values are not consistent with the call that triggers the
 filter.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31568>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list