I keep seeing this pattern, and wonder what it's for, how WP uses it internally:
if ( empty($post) ) {
if ( isset($GLOBALS['post']) )
$_post = & $GLOBALS['post'];
else
return $null;
} elseif ( is_object($post) && empty($post->filter) ) {
_get_post_ancestors($post);
$_post = sanitize_post($post, 'raw');
wp_cache_add($post->ID, $_post, 'posts');
} else {
if ( is_object($post) )
$post_id = $post->ID;
else
$post_id = $post;
The specific line in question is is_object($post) && empty($post->filter)
. I've seen this filter
property associated with other objects as well. Wondering what it does and how it can be used?
EDIT
I'm hoping to get more input on this! Unfortunately, a Google search with "filter" in it only turns up Filter hooks etc. This is a tough one to get independent info on. Buehler?
$post->filter
needed to be set. It didn't explain what it was, why it was there, or how it's used in core. I agree with the 2 votes cast to re-open.