[wp-trac] [WordPress Trac] #24672: Remove final from WP_Post class

WordPress Trac noreply at wordpress.org
Thu Apr 5 19:05:55 UTC 2018


#24672: Remove final from WP_Post class
-------------------------------+------------------------------
 Reporter:  carlalexander      |       Owner:
     Type:  enhancement        |      Status:  reopened
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  3.5
 Severity:  normal             |  Resolution:
 Keywords:  2nd-opinion        |     Focuses:
-------------------------------+------------------------------

Comment (by Andy Schmidt):

 Replying to [comment:21 jorbin]:
 > when a plugin adds a method that returns unescaped data and handles the
 escaping later and later core adds a method with the same name where it is
 returned escaped

 That sounds more like "name spacing" issue? That same potential exists if
 a plug-in creates a regular function in the root name space and later
 WordPress adding a function by that same name?

 If developers add methods or properties, it is their responsibility to
 choose member names for which their is a reasonable expectation that they
 are highly unique to avoid future name clashes.

 And as far as escaping - I've come across filters/hooks in WordPress that
 expressly instruct developers that the return value should be escaped. So
 the potential of someone not reading carefully (or copying imperfect code
 samples somewhere) and NOT escaping the return values is also not specific
 to the ability to extending the WP_Post class?

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


More information about the wp-trac mailing list