function update_post_meta_check($post_id, $key, $value) { $old = get_post_meta($post_id, $key, true); if ($old == $value) { return false; } else { return update_post_meta($post_id, $key, $value); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter