WordPress.org

Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #26877, comment 3


Ignore:
Timestamp:
02/17/2014 08:56:13 PM (8 years ago)
Author:
MikeSchinkel
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26877, comment 3

    v1 v2  
    99I don't understand what you mean by _"use a theme function"_;  Are you saying that because I chose `title()` as the one methods I showed ''(vs. one of the other 25+ methods in my actual class)'' that I am ''"using a theme function?"'' If yes, note that rather than overwhelm the reader I was trying to show the smallest example I could, and yes `$post->title()` is not that beneficial. But `$post->the_video_embed()`, `$post->the_featured_image()` and `$post->do_show_excerpt()` might help you visualize it better.
    1010
    11 What I want to do is be able to add properties and behavior to the `$post` object so that when I pass the `$post` object around, especially through other people's code that the properties and behavior follow along with it. This is just OOP 101 and wasn't something I though needed had to be made highly convincing. 
     11What I want to do is be able to add properties and behavior to the `$post` object so that when I pass the `$post` object around, especially through other people's code that the properties and behavior follow along with it. This is just OOP 101 and wasn't something I though needed to be made highly convincing. 
    1212
    1313I understand and appreciate [/ticket/24672#comment:3 @nacin's reluctance to remove final] which is why my patch did not propose final but instead used containment. The problem is we can't use containment if all the methods that would work with posts throw away our instances when they call `get_post()` which is the reason for my proposal.