[wp-trac] [WordPress Trac] #48415: Calling current_user_can( 'publish_post' ) results in Notice on 5.3-RC2-46574

WordPress Trac noreply at wordpress.org
Thu Oct 24 00:00:17 UTC 2019


#48415: Calling current_user_can( 'publish_post' ) results in Notice on
5.3-RC2-46574
----------------------------+----------------------
 Reporter:  johnstonphilip  |       Owner:  (none)
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:
Component:  Users           |     Version:
 Severity:  normal          |  Resolution:  invalid
 Keywords:  close           |     Focuses:
----------------------------+----------------------
Changes (by azaozz):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  5.3 =>


Comment:

 Right. The `'publish_post'` capability check requires a post ID. It won't
 work without it, same as calling a function and not passing a required
 param. Don't think using the spread operator changes anything here. The
 same `Notice: Undefined offset: 0` is thrown in 5.2.

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


More information about the wp-trac mailing list