[wp-trac] [WordPress Trac] #36514: posting with custom taxes

WordPress Trac noreply at wordpress.org
Sat Mar 4 00:30:06 UTC 2017


#36514: posting with custom taxes
-------------------------------------------------+-------------------------
 Reporter:  hokku                                |       Owner:  helen
     Type:  defect (bug)                         |      Status:  reviewing
 Priority:  normal                               |   Milestone:  Future
Component:  Taxonomy                             |  Release
 Severity:  normal                               |     Version:  4.2
 Keywords:  2nd-opinion has-patch 4.8-early      |  Resolution:
  has-unit-tests                                 |     Focuses:
                                                 |  administration
-------------------------------------------------+-------------------------
Changes (by ZaneMatthew):

 * keywords:  2nd-opinion has-patch 4.8-early needs-unit-tests => 2nd-
     opinion has-patch 4.8-early has-unit-tests


Comment:

 [attachment:36514.4.diff]

 I've submitted a unit test for the proposed patch. The unit test failed
 before applying the patch, and passed once the patch was applied.

 I was able to manually reproduced the issue via the WP Admin. I then
 created a unit test that;

 - registers a given taxonomy based on the reporters criteria,
 - creates a post and term for the newly registered taxonomy,
 - sets the current user to editor role,
 - uses `edit_post()` to apply the newly created term to the given post,

 I verified that WordPress did create a new term with the term ID as the
 term, vs. adding the term to the post.

 I then applied the patch, re-run the test, and the test passed.

 One item to note is that to fully simulate the process of editing a post
 from the WP Admin, the `$term_id` had to be type casted as `(string)
 $term_id`.

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


More information about the wp-trac mailing list