[wp-trac] [WordPress Trac] #52995: Undefined `$post_ID` variable in `edit-form-blocks.php`

WordPress Trac noreply at wordpress.org
Tue May 18 16:59:02 UTC 2021


#52995: Undefined `$post_ID` variable in `edit-form-blocks.php`
--------------------------+-----------------------------
 Reporter:  ravipatel     |       Owner:  SergeyBiryukov
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  5.8
Component:  Editor        |     Version:  5.0
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------------

Comment (by grantmkin):

 I believe this caused an unintended change, `$post->ID` can be a string in
 some cases, and it's used in strict comparison with an `int` here:
 https://github.com/WordPress/wordpress-
 develop/blob/c00ba50d598abb1cd8aaba057da9555a452ffcee/src/wp-admin/edit-
 form-advanced.php#L81.

 This prevents the notice from showing when editing the posts page
 (https://github.com/WordPress/wordpress-
 develop/blob/c00ba50d598abb1cd8aaba057da9555a452ffcee/src/wp-
 admin/includes/template.php#L2668).

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


More information about the wp-trac mailing list