I've had a little bit of time to look into this issue a little further, and there's one problem on my side. I'm having a difficult time trying to reproduce the issue. The sanitize_post function is triggered when there is 'raw' data found, and everything on my side keeps using proper data.
My guess right now is that what ever is being passed into that function doesn't match up to WordPress's configuration. This could be a post type, taxonomy, or page saved in the database, and this isn't because of the APL Plugin necessarily, but I can create something to fall back on. Some other plugin's also use post types in a different fashion, and if that's the case, I could set it up to ignore it. Especially if it has no relation to the APL plugin's purpose.
I'm unable to get my stuff to debug inside the function, and since you already have the event being triggered. Could you modify the function where the error is occurring? ...and then post the results?
Old function
function sanitize_post($post, $context = 'display') {
if ( is_object($post) ) {
// Check if post already filtered for this context
if ( isset($post->filter) && $context == $post->filter )
return $post;
if ( !isset($post->ID) )
$post->ID = 0;
foreach ( array_keys(get_object_vars($post)) as $field )
$post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context);
$post->filter = $context;
} else {
// Check if post already filtered for this context
if ( isset($post['filter']) && $context == $post['filter'] )
return $post;
if ( !isset($post['ID']) )
$post['ID'] = 0;
foreach ( array_keys($post) as $field )
$post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context);
$post['filter'] = $context;
}
return $post;
}
Modified function
function sanitize_post($post, $context = 'display') {
if ( is_object($post) ) {
// Check if post already filtered for this context
if ( isset($post->filter) && $context == $post->filter )
return $post;
if ( !isset($post->ID) )
$post->ID = 0;
//Modify this foreach, add brackets and the echo line
foreach ( array_keys(get_object_vars($post)) as $field ){
echo '$field = ' + $field + '\n$post->field = ' + $post->$field + '\n$post->ID = ' + $post->ID + '\n$context = ' + $context + '\n\n';
$post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context);
}
$post->filter = $context;
} else {
// Check if post already filtered for this context
if ( isset($post['filter']) && $context == $post['filter'] )
return $post;
if ( !isset($post['ID']) )
$post['ID'] = 0;
foreach ( array_keys($post) as $field )
$post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context);
$post['filter'] = $context;
}
return $post;
}
Sorry for a late reply. A lot going on in the world today.