[wp-trac] [WordPress Trac] #41293: wp_get_post_terms do not work with 'id=>name' argument

WordPress Trac noreply at wordpress.org
Tue Oct 10 14:02:56 UTC 2017


#41293: wp_get_post_terms do not work with 'id=>name' argument
--------------------------+-----------------------
 Reporter:  dany2217      |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  4.9
Component:  Taxonomy      |     Version:  4.7.5
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------
Changes (by boonebgorges):

 * keywords:  needs-unit-tests has-patch => has-patch


Comment:

 @miyauchi Thanks very much for the patch, and especially for the test
 demonstrating the problem!

 In [attachment:41293.3.patch] I made a few modifications to
 [attachment:41293.2.patch]:

 - I've moved the test to a more appropriate file
 - I made the test a bit more targeted, using `wp_get_object_terms()`
 rather than `wp_get_post_terms()`, and using factory methods to create
 fixtures rather than `edit_post()`.
 - I changed the logic of the `array_merge()` vs array-concatenation
 routine, so that it more clearly reflects the cases in which concatenation
 must be used

 Could others please have a look and verify the new patch?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41293#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list