[wp-trac] [WordPress Trac] #60710: save_post_{$post->post_type} hook returns inconsistent $_POST['tax_input'] format

WordPress Trac noreply at wordpress.org
Wed Mar 6 19:55:52 UTC 2024


#60710: save_post_{$post->post_type} hook returns inconsistent $_POST['tax_input']
format
----------------------------+-----------------------------
 Reporter:  jenUnderscore_  |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Taxonomy        |    Version:  6.4.3
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 In the save_post_{$post->post_type} hook:

 **Case 1**: If we do not make any changes to the taxonomy
 `$_POST['tax_input'][$term]` returns a comma delimited string WITH a
 space.

 Output Example: ''Maple, Spring, Summer, Winter''

 **Case 2**: If we modify the taxonomy (adding or removing), it eliminates
 the space:

 Output Example: ''Spring,Summer,Winter''

 Proposed solution, eliminate the space in the first case for consistency.

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


More information about the wp-trac mailing list