[wp-trac] [WordPress Trac] #20765: get_attachment_fields_to_edit() returns term->name rather than term->slug, causing conflicts between terms

WordPress Trac wp-trac at lists.automattic.com
Tue May 29 01:52:21 UTC 2012


#20765: get_attachment_fields_to_edit() returns term->name rather than term->slug,
causing conflicts between terms
--------------------------+------------------------------
 Reporter:  eddiemoya     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Comment (by eddiemoya):

 To be clear, the conflict is seen and data is lost when two terms of the
 same name are applied to an attachment and saved, then re-opened, and
 saved once again. Because the media page renders outputs the term names,
 it will always assume that the first term is finds with that name is the
 correct one.

 There is no way through javascript or otherwise, to fix this, since there
 is no way to know which was the originally intended term. I've managed to
 work around this in my plugin by filtering the function that does this,
 duplicating all the code, except switching it to slugs instead.

 [http://plugins.trac.wordpress.org/changeset/549552/media-
 categories-2/tags/1.3.1/media-categories.php]

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


More information about the wp-trac mailing list