[wp-trac] [WordPress Trac] #32585: Programmatically using wp_insert_post with post_author=0 does not work when user is logged in

WordPress Trac noreply at wordpress.org
Sat Sep 12 18:53:58 UTC 2015


#32585: Programmatically using wp_insert_post with post_author=0 does not work when
user is logged in
-------------------------------------------------+-------------------------
 Reporter:  ericdaams                            |       Owner:
     Type:  defect (bug)                         |  wonderboymusic
 Priority:  normal                               |      Status:  closed
Component:  Posts, Post Types                    |   Milestone:  Awaiting
 Severity:  normal                               |  Review
 Keywords:  has-patch needs-testing needs-unit-  |     Version:
  tests                                          |  Resolution:  fixed
                                                 |     Focuses:
-------------------------------------------------+-------------------------
Changes (by wonderboymusic):

 * owner:   => wonderboymusic
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"34085"]:
 {{{
 #!CommitTicketReference repository="" revision="34085"
 In `wp_insert_post()`, when setting `$post_author`, use `isset()` instead
 of `! empty()` to allow `0` to be passed as the value for `$post_author`.

 Adds unit tests.

 Props ericdaams, wonderboymusic.
 Fixes #32585.
 }}}

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


More information about the wp-trac mailing list