[wp-hackers] A new $comment_type?

Scott Reilly scottr at gmail.com
Thu Jan 20 18:28:19 GMT 2005


It should also be worth mentioning that a $comment_type of '' is valid
and equivalent to 'comment'.  While I personally prefer the field to
be explicit, Matt has indicated to me that it won't be so (at least at
that point in time).

However, I do favor that get_comment_type() in
wp-includes/comment-functions.php return 'comment' if the comment_type
is '', rather than returning the  empty string for comments not
explicitly noted to be 'comments'.  Shouldn't be any harm in that,
right?  And saves from having to do the following if you want to know
if a comment is a "comment":

$comment_type = get_comment_type();
if ( '' == $comment_type || 'comment' == $comment_type ) { ... }

Especially for those not aware either case means "comment".


-Scott (coffee2code)


On Thu, 20 Jan 2005 10:10:32 -0800, Matthew Mullenweg <m at mullenweg.com> wrote:
> David Clark wrote:
> > Right now, $comment_type can have  one of 3 values, comment, trackback,
> > or pingback. I would like a 4th for page_comments -- here's why:
> 
> Since they're treated transparently (no speed benefit from ENUM) they
> could be just plain strings without any changes.
>


More information about the hackers mailing list