Don't return early before filtering.
git-svn-id: https://develop.svn.wordpress.org/trunk@7161 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
dc3a3d242c
commit
d1a9adb980
@ -725,13 +725,9 @@ function sanitize_post($post, $context = 'display') {
|
||||
if ( 'raw' == $context )
|
||||
return $post;
|
||||
if ( is_object($post) ) {
|
||||
if ( !isset($post->ID) )
|
||||
return $post;
|
||||
foreach ( array_keys(get_object_vars($post)) as $field )
|
||||
$post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context);
|
||||
} else {
|
||||
if ( !isset($post['ID']) )
|
||||
return $post;
|
||||
foreach ( array_keys($post) as $field )
|
||||
$post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user