WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#32515 closed defect (bug) (fixed)

Don't declare class properties readonly if they're written to later

Reported by: morganestes Owned by: wonderboymusic
Milestone: 4.3 Priority: normal
Severity: normal Version: 4.2
Component: Posts, Post Types Keywords: has-patch
Focuses: docs Cc:

Description (last modified by netweb)

Introduced in r31127, WP_Post::page_template is declared read-only, but is written to inside the class. This updates the docblock so my IDE quits yelling at me that I'm writing to a read-only property.

Attachments (1)

32515.diff (462 bytes) - added by morganestes 6 years ago.

Download all attachments as: .zip

Change History (4)

@morganestes
6 years ago

#1 @DrewAPicture
6 years ago

  • Component changed from Editor to Posts, Post Types
  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.3
  • Owner set to wonderboymusic
  • Status changed from new to reviewing

#2 @netweb
6 years ago

  • Description modified (diff)

#3 @wonderboymusic
6 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 32729:

page_template should be annotated as @property, not @property-read in WP_Post. The property is set on an instance in wp_insert_post()

Props morganestes.
Fixes #32515.

Note: See TracTickets for help on using tickets.