[wp-trac] [WordPress Trac] #22338: Add filter for the output from `get_sample_permalink`

WordPress Trac noreply at wordpress.org
Wed Oct 31 22:32:42 UTC 2012


#22338: Add filter for the output from `get_sample_permalink`
------------------------------------+--------------------------
 Reporter:  simonwheatley           |       Type:  defect (bug)
   Status:  new                     |   Priority:  normal
Milestone:  Awaiting Review         |  Component:  Permalinks
  Version:  3.4.2                   |   Severity:  normal
 Keywords:  has-patch dev-feedback  |
------------------------------------+--------------------------
 When getting the sample permalink the `post_name` is not always set in the
 Post object at this point. The `get_sample_permalink` gets around this by
 hacking the `post_name` into the Post object for the duration of the
 function, however it is not possible to get this "hacked in" information
 from the `post_type_link` filter. I suggest that a filter should be added
 to the `$permalink` array (which contains the link and the post name
 string) and various additional parameters, including the hacked Post
 object.

 The alternative would be to try to detect situations where the data needs
 to be hacked in, e.g. watching for particular `action` GET params in an
 AJAX context, but this seems like a hack too far.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22338>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list