When running the following code:
update_post_meta( 1, '_visibility', 'visible' );
Does wordpress check to see if post_id 1
key _visable
has a value of visible
before writing to database?
I have an import script and I'm wondering is this would save processing time.
function update_post_meta_check($post_id, $key, $value) {
$old = get_post_meta($post_id, $key);
if ($old == $value) {
return false;
} else {
return update_post_meta($post_id, $key, $value);
}
}
Or does Wordpress already do this check itself?
For reference I expect many of my post meta to remain unchanged - so the extra get_post_meta
will be ok if i can bypas alot of update_post_meta
's...